cut

Extract specific fields or character ranges from text.

low risk

interactive breakdown — edit the command and press Explain
$ 
What it does

cut extracts columns from text by delimiter (-d and -f) or character position (-c). A staple for parsing structured output like /etc/passwd, CSV files, or command output with consistent delimiters.

Common flags
FlagMeaning
-d --delimiterSet field delimiter (default: TAB)
-f --fieldsSelect specific fields (1-indexed)
-c --charactersSelect specific character positions
Examples
cut -d: -f1 /etc/passwdExtract just usernames · explain & risk-check →
cut -d, -f1,3 data.csvExtract first and third CSV columns · explain & risk-check →
echo 'hello world' | cut -d' ' -f2Extract second word · explain & risk-check →
cut -c1-10 longfile.txtShow only first 10 characters per line · explain & risk-check →
Pro tip

For multi-character delimiters or more complex field logic, switch to `awk -F 'delim' '{print $2}'` — cut only supports single-character delimiters.

Related
awk tr sed
Open the full explainer →More in Text Processing

Reference text is hand-written and may be incomplete — check man cut for your version. Test destructive commands on a non-production system first.