man.lsPlain-English help for Unix commands

cut Extract columns from each line

Pulls out selected fields or character positions from every line of input. Use it to take one or two columns from a delimited file such as a CSV, or the first few characters of each line.

Synopsis

cut -f LIST [-d DELIM] [-s] [FILE]...
cut -c LIST [FILE]...
cut -b LIST [FILE]...

Common options

Option or formWhat it does
-d DELIMSet the field delimiter used with -f. The default is a tab. Use -d, for CSV
-f LISTSelect fields by number, counting from 1. LIST can be 2, 1,3 or 2-4
-c LISTSelect characters by position, such as -c1-10 for the first ten
-b LISTSelect bytes by position. Can split multi-byte characters, so -c is usually better
-sWith -f, skip lines that contain no delimiter. Without it, those lines are printed whole
-wmacOS and BSD only: treat runs of spaces and tabs as one delimiter. GNU cut does not have it

Examples

Take the first column of a CSV
cut -d, -f1 data.csv
name
ana
bo
cy
dee
Take columns 1 and 3
cut -d, -f1,3 data.csv
name,score
ana,7
bo,3
cy,9
dee,3
Take the first 10 characters of each line
cut -c1-10 app.log
2026-01-01
2026-01-01
2026-01-02
2026-01-02
Take the second space-separated field
cut -d' ' -f2 app.log
INFO
ERROR
WARN
ERROR
Count the rows in each team, skipping the header
tail -n +2 data.csv | cut -d, -f2 | sort | uniq -c
List the login names on a system
cut -d: -f1 /etc/passwd

Notes

See also

Last reviewed 2026-10-07.