CUT(1)

NAME
cut - Prints specified byte or field columns from each line of stdin or the input files

SYNOPSIS
cut [-b|--bytes] [-c|--characters] [-d|--delimiter] [-w ] [-f|--fields] [--complement] [-s|--only-delimited] [-z|--zero-terminated] [-O|--output-delimiter] [-n|--no-partial] [-h|--help] [-V|--version] [file]

DESCRIPTION
Prints specified byte or field columns from each line of stdin or the input files

OPTIONS

-b, --bytes <LIST>
    filter byte columns from the input source

-c, --characters <LIST>
    alias for character mode

-d, --delimiter <DELIM>
    specify the delimiter character that separates fields in the input source. Defaults to Tab.

-w  Use any number of whitespace (Space, Tab) to separate fields in the input source (FreeBSD extension).

-f, --fields <LIST>
    filter field columns from the input source

--complement
    invert the filter - instead of displaying only the filtered columns, display all but those columns

-s, --only-delimited
    in field mode, only print lines which contain the delimiter

-z, --zero-terminated
    instead of filtering columns based on line, filter columns based on \0 (NULL character)

-O, --output-delimiter <NEW_DELIM>
    in field mode, replace the delimiter in output lines with this option's argument

-n, --no-partial
    with -b, don't output partial multi-byte characters

-h, --help
    Print help

-V, --version
    Print version

EXTRA
## Examples Print the fifth character on each line: {{command}} | cut {{[-c|--characters]}} 5 Print the fifth to tenth character of each line of the specified file: cut {{[-c|--characters]}} 5-10 {{path/to/file}} Split each line in a file by a delimiter into fields and print fields two and six (default delimiter is `TAB`): cut {{[-f|--fields]}} 2,6 {{path/to/file}} Split each line by the specified delimiter and print all from the second field onward: {{command}} | cut {{[-d|--delimiter]}} "{{delimiter}}" {{[-f|--fields]}} 2- Use space as a delimiter and print only the first 3 fields: {{command}} | cut {{[-d|--delimiter]}} " " {{[-f|--fields]}} -3 Only print lines that contain the delimiter: {{command}} | cut {{[-d|--delimiter]}} "{{:}}" {{[-f|--fields]}} {{1}} {{[-s|--only-delimited]}} Print specific fields of lines that use `NUL` to terminate lines instead of newlines: {{find . -print0}} | cut {{[-z|--zero-terminated]}} {{[-d|--delimiter]}} "{{/}}" {{[-f|--fields]}} {{2}} > The examples are provided by the [tldr-pages project](https://tldr.sh) under the [CC BY 4.0 License](https://github.com/tldr-pages/tldr/blob/main/LICENSE.md). > > Please note that, as uutils is a work in progress, some examples might fail.

VERSION
v(uutils coreutils) 0.10.0