[Shell command] Extract a column from simple CSV with cut

Created on November 30, 2026

When commas appear only as field separators, you can use cut to extract a column. Save this as dummy.csv.

"name","age"
"suzuki","15"
"tanaka","20"
"sato","25"

-d ',' selects the comma delimiter. -f 2 selects the second column, age.

cut -d ',' -f 2 dummy.csv
"age"
"15"
"20"
"25"

cut treats quotes as ordinary characters. Use a CSV parser for fields that contain quoted commas or line breaks.

Shell command