Print the first and third fields from a CSV-like file.

Section: cut and paste

Extract comma-delimited fields

bash
bash
cut -d, -f1,3 users.csv
Explanation

`cut` is fast and simple for delimited text when quoting rules are uncomplicated.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing cut and paste
Extract character positions
Print characters 1 through 8 from each line.
OpenIn sheetbashsame section
Exclude selected fields
Print all fields except one.
OpenIn sheetbashsame section
Merge files side by side
Combine lines from two files into columns.
OpenIn sheetbashsame section
Paste with a custom delimiter
Combine files using commas or tabs.
OpenIn sheetbashsame section
Join on a different field number
Specify alternate join fields.
OpenIn sheetbash1 tag match
Sort lines alphabetically
Default lexicographic sort.