Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

cut

v(uutils coreutils) 0.1.0

Options

--bytes=<LIST>, -b <LIST>

cut-help-bytes

--characters=<LIST>, -c <LIST>

cut-help-characters

--delimiter=<DELIM>, -d <DELIM>

cut-help-delimiter

-w <WHITESPACE>

cut-help-whitespace-delimited

--fields=<LIST>, -f <LIST>

cut-help-fields

--complement

cut-help-complement

--only-delimited, -s

cut-help-only-delimited

--zero-terminated, -z

cut-help-zero-terminated

--output-delimiter=<NEW_DELIM>

cut-help-output-delimiter

Examples

Print a specific [c]haracter/[f]ield range of each line:

{{command}} | cut --{{characters|fields}} {{1|1,10|1-10|1-|-10}}

Print a field range of each line with a specific delimiter:

{{command}} | cut {{[-d|--delimiter]}} "{{delimiter}}" {{[-f|--fields]}} {{1|1,10|1-10|1-|-10}}

Print a character range of each line of the specific file:

cut {{[-c|--characters]}} {{1}} {{path/to/file}}

Print specific fields of NUL terminated lines (e.g. as in find . -print0) instead of newlines:

{{command}} | cut {{[-z|--zero-terminated]}} {{[-f|--fields]}} {{1}}

The examples are provided by the tldr-pages project under the CC BY 4.0 License.

Please note that, as uutils is a work in progress, some examples might fail.