I am using Red Hat linux.
I have a file foo.txt which reads
Hello world I am foo
I want to get the last word which is foo when I do cat
I tried seeing a few posts here which explained to use cut command but its very confusing. Can somebody help me getting this right?
I am looking for a command which migh go something like below
cat foo.txt | cut <the options to get the last word /or last 3 characters>