awk '{print $1}' file.txt

Category: Text Processing

awk '{print $1}' file.txt

Print the first field of each line (space-delimited)

awk is a powerful text-processing tool. $1 refers to the first field (column) of each line, split by spaces by default.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.