Bash 5 reference · Text and System Tools
cut (Linux command)
Extract columns from each line by delimiter and field number, or by character positions.
Bash 5
Syntax
cut -d DELIM -f FIELDS [FILE] cut -c RANGE [FILE]
Parameters
| Parameter | Description |
|---|---|
-d , |
Delimiter (one character). |
-f 1,3 / -f 2- |
Fields to keep. |
-c 1-8 |
Character positions. |
Examples
echo 'ana,DE,31' | cut -d, -f1,3
echo 'ana,DE,31' | cut -d, -f2-
Output
ana,31 DE,31
Run this on your computer — see “Get Started” for setup.
echo '2026-01-15T10:00:00Z' | cut -c1-10
Output
2026-01-15
Run this on your computer — see “Get Started” for setup.
Related
awk· Process text by fields: print and filter columns, compute sums and group totals, with a small built-in language.tr· Translate, squeeze or delete characters, such as changing case, removing carriage returns or splitting words onto lines.- Bash sort, uniq, cut and tr · tutorial