Cut command

The cut command has the feature of being able to cut characters and fields, with the possibility of using delimiters and other options, to finally extract selected from each file to standard output parties.

The cut command offers the following arguments;

-b, –bytes=LIST select only these bytes

-c, –characters=LIST select only these characters

-d, –delimiter=DELIM use DELIM instead of TAB for field delimiter

-f, –fields=LIST select only these fields; also print any line that contains no delimiter character, unless the -s option is specified

–complement complement the set of selected bytes, characters or fields

-s, –only-delimited do not print lines not containing delimiters

–output-delimiter=STRING
use STRING as the output delimiter the default is to use the input delimiter

–help display this help and exit

–version output version information and exit

Some example:

1 - Remove the first field in a delimited file screen by a space

cut

2 - Remove the first and third display field in a delimited file by spaces :

cut

3 - Take the first 4 characters of a file

cut

 

more information cut

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>