cut -d: -f1 /etc/passwd

Category: File Viewing & Editing

cut -d: -f1 /etc/passwd

Extract the first field from colon-delimited file

Extracts a specific field from each line of a file that uses a delimiter character (here, : for /etc/passwd). -d sets the delimiter, -f selects the field number.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.