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 form | What it does |
|---|---|
-d DELIM | Set the field delimiter used with -f. The default is a tab. Use -d, for CSV |
-f LIST | Select fields by number, counting from 1. LIST can be 2, 1,3 or 2-4 |
-c LIST | Select characters by position, such as -c1-10 for the first ten |
-b LIST | Select bytes by position. Can split multi-byte characters, so -c is usually better |
-s | With -f, skip lines that contain no delimiter. Without it, those lines are printed whole |
-w | macOS and BSD only: treat runs of spaces and tabs as one delimiter. GNU cut does not have it |
Examples
cut -d, -f1 data.csv
name
ana
bo
cy
dee
cut -d, -f1,3 data.csv
name,score
ana,7
bo,3
cy,9
dee,3
cut -c1-10 app.log
2026-01-01
2026-01-01
2026-01-02
2026-01-02
cut -d' ' -f2 app.log
INFO
ERROR
WARN
ERROR
tail -n +2 data.csv | cut -d, -f2 | sort | uniq -c
cut -d: -f1 /etc/passwd
Notes
- cut treats every delimiter as a separator. Two spaces in a row make an empty field between them, so it works badly on columns aligned with spaces. Use awk for those.
- cut does not understand CSV quoting. A comma inside a quoted value still splits the field.
- cut cannot reorder columns. -f3,1 prints the same as -f1,3, always in input order. Use awk to change the order.
- The delimiter must be a single character. For anything longer, use awk -F.
- Lines without the delimiter are printed in full unless you add -s.
See also
Last reviewed 2026-10-07.