How to use cut command in bash to show all columns except those indicated? How to use cut command in bash to show all columns except those indicated? bash bash

How to use cut command in bash to show all columns except those indicated?


Using cut:

cut -d ' ' -f 2- input-file

should do what you want.


To read infile using ' ' as a delimiter (-d) and put fields (-f) 2 onwards (2-) into file:

cut -d' ' -f2- infile > file

See man cut for more options.

N.B: This is not -specific.


GNU coreutils cut supports the --complement flag. So if you are using that version of cut you can say:

cut --complement -d' ' -f1 infile

Output:

Procedimiento_tal retiro aceptadotx1tx2tx3Procedimiento_tal retiro rechazadotx1tx2tx3Procedimiento_tal retiro aceptadotx1tx2tx3