Go to the first, previous, next, last section, table of contents.


8.1 cut: Print selected parts of lines

cut writes to standard output selected parts of each line of each input file, or standard input if no files are given or for a file name of `-'. Synopsis:

cut [option]... [file]...

In the table which follows, the byte-list, character-list, and field-list are one or more numbers or ranges (two numbers separated by a dash) separated by commas. Bytes, characters, and fields are numbered from starting at 1. Incomplete ranges may be given: `-m' means `1-m'; `n-' means `n' through end of line or last field.

The program accepts the following options. Also see section 2 Common options.

`-b byte-list'
`--bytes=byte-list'
Print only the bytes in positions listed in byte-list. Tabs and backspaces are treated like any other character; they take up 1 byte.
`-c character-list'
`--characters=character-list'
Print only characters in positions listed in character-list. The same as `-b' for now, but internationalization will change that. Tabs and backspaces are treated like any other character; they take up 1 character.
`-f field-list'
`--fields=field-list'
Print only the fields listed in field-list. Fields are separated by a TAB character by default.
`-d input_delim_byte'
`--delimiter=input_delim_byte'
For `-f', fields are separated in the input by the first character in input_delim_byte (default is TAB).
`-n'
Do not split multi-byte characters (no-op for now).
`-s'
`--only-delimited'
For `-f', do not print lines that do not contain the field separator character.
`--output-delimiter=output_delim_string'
For `-f', output fields are separated by output_delim_string The default is to use the input delimiter.


Go to the first, previous, next, last section, table of contents.