cut: extract columns from text

Updated November 2026

cut prints selected parts of each line: fields separated by a delimiter, or character positions. It is simpler and faster than awk when the input has a single, consistent separator.

cut -d DELIM -f FIELDS [file ...] cut -c CHARACTERS [file ...]

Examples

cut -d: -f1 /etc/passwd             # user names
cut -d: -f1,6 /etc/passwd           # user and home directory
cut -d, -f2-4 data.csv              # columns 2 to 4
cut -d, -f3- data.csv               # column 3 to the end
cut -c1-10 file.txt                 # first 10 characters of each line (ASCII text, see below)
cut -f2 table.tsv                   # tab is the default delimiter
cut -d' ' -f1 access.log | sort | uniq -c | sort -rn | head   # top client IPs
cut -d: -f1 --complement /etc/passwd   # everything except field 1 (GNU)
cut -d: -f1,7 --output-delimiter=' ' /etc/passwd             # GNU

Limits

paste -d, names.txt emails.txt          # join files line by line, side by side
paste -sd+ numbers.txt | bc             # sum a column of numbers
tr 'a-z' 'A-Z' < file.txt               # upper case
tr -d '\r' < windows.txt > unix.txt     # remove Windows carriage returns
tr -s ' ' < file.txt                    # squeeze repeated spaces