Text processing tool. Manipulate and analyse text files in a line by line manner. Useful for extracting fields, filtering data, performing calculations.
awk 'pattern { action }' input_file
Print for each lines the given field. By default, fields are separated
by spaces. The field to print is specified with $n.
awk '{ print $2, $3 }' input_file
The field separator can be specified with the -F flag.
awk -F ',' '{ print $5 }' input_file
NR current line numberNF number of fileds in current line$0 entire current line$1, $2…individual fields of current lineawk '{ if ($1 > 10) print $0 }' input_file