Ravi Sir's Cards › AWS
awk in 4 steps
This revision card explains awk in 4 steps. It starts from the need that print a column. It describes set separator. The how-to section notes filter rows. An example on the card is sum at END.
Read card text
What this card says
Why do we need it?
Print a column.
awk '{print $1}' f
What is it?
Set separator.
awk -F, '{print $2}' f.csv
How to do it
Filter rows.
awk '$3>100' f
Example
Sum at END.
awk '{s+=$3}END{print s}' f