CUT(1) General Commands Manual CUT(1)

cut - Extract sections from each line of files.

cut OPTION... [FILE]...

Extract sections from each line of files.

extract bytes listed in LIST
extract characters listed in LIST
use DELIM as field separator (default: Tab)
use any whitespace (Space/Tab) as delimiter; ignore leading and trailing blanks with 'trimmed'

Possible values:

trimmed
extract fields listed in LIST
like -f, but merge adjacent delimiters; the delimiter defaults to whitespace and the output delimiter to a space
invert selection: print all columns except the specified ones
suppress lines that do not contain the delimiter
use NULL (\0) instead of newline as line terminator
replace input delimiter with NEW_DELIM in output
with -b, do not output partial multi-byte characters
Print help
Print version

If no FILE is specified, reads from stdin. Use '-' as a FILE argument to include stdin.

LIST is a comma-separated list of numbers or ranges:


N only column N
N- columns N through the end of the line
N-M columns N through M
-M columns 1 through M

Examples:


cut -f 2,5-7 file.txt extract fields 2, 5, 6, and 7
cut -f 3- file.txt extract field 3 to the end of the line
cut --complement -f 4-6 file.txt extract all fields except 4, 5, and 6
cut -d',' -f1 file.csv extract first field from a CSV

v(uutils coreutils) 0.11.0

2026-09-01