Column-Based Text Processing
SH · Text Processingsyntax
awk 'pattern { action }' fileexample
awk '{print $1, $4}' access.log
awk -F',' '$3 > 1000 {print $1, $3}' sales.csv
awk '{sum += $5} END {print "Total:", sum}' report.tsvoutput
192.168.1.40 [28/Mar/2026:10:15:23
Alice 2340
Total: 87450Note By default, awk splits on whitespace. -F sets a custom delimiter. $0 is the whole line, $1 is the first field, NR is the line number, NF is the number of fields. BEGIN runs before processing; END runs after.