cut -d -f: pull columns from delimited files
Extract CSV fields or colon-separated values on Linux with cut -d, plus character ranges with -c.
Run cut -d, -f1,3 FILE for comma-delimited fields, or cut -c1-8 FILE to keep the first 8 characters of every line.
01Command
Command
$ cut -d, -f1,3 data.csv && cut -d: -f1 /etc/passwd02What it does
cut is the lightweight sibling of awk for fixed-delimiter data: -d sets the single-character separator, -f takes a comma-separated field list and even ranges (-f2-4,7), and -c/-b slice by position instead of field. It is a one-purpose tool — far faster to type than an awk program — but remembers its limits: unlike awk, it cannot skip repeated separators, so consecutive commas count as an empty field.
03Risk
!Warning: cut -d only accepts a single character; multi-character delimiters require awk or sed.
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- cut(1P) — POSIX manual pageEvidence: POSIX defines -d, -f, -c and -b selection semantics
- cut(1) — Arch Linux manualEvidence: -d delim sets the field delimiter, -f selects fields, -c/-b select character/byte ranges
Last verified: 2026-09-17 · Category: Files & Folders