What does cut do?
cut takes columns out of each line, split by a delimiter (-d) and choosing fields (-f).
cut -d DELIM -f FIELDS [file]
Most useful options
| Option | What it does |
|---|---|
| -d | delimiter, e.g. -d: or -d, |
| -f | fields, e.g. -f1 or -f1,3 |
| -c | characters, e.g. -c1-8 |
cut examples
In security work
cut -d, -f2 data.csv pulls one column out of a CSV export in a second.
Questions about cut
What is the difference between cut and awk?
cut is simple and fast with one fixed delimiter; awk handles spaces of any width and can do logic.