I have the following command.
(head -1 invoice.txt && sed '1d' invoice.txt |sort -rn -k4,4) |column -ts $'\t' |less -S
head -1prints the first line.sed "1d'removes the first line so soft wont be confusedsort -rn -k4,4sorts my file by the 4th column onlycolumn -ts $'\t'splits the file by tabless -Sprints it on the terminal
I would like to print only the first, fourth and last column. This is a small file however I have one with fourteen and one with twenty one columns, that i will use this template on.
And I am not sure if to use cut, awk, print or other command to pipe for my current output.