To print a whole word, you want -f 1
, not -c 1
. And since the default field delimiter is TAB rather than SPACE, you need to use the -d
option.
cut -d' ' -f1 filename
To print the last two words not possible with cut
, AFAIK, because it can only count from the beginning of the line. Use awk
instead:
awk '{print $(NF-1), $NF;}' filename