awk1page

an awk program is a series of pattern { actions } statements;
ie if the input line matchs pattern then the actions are performed.

/abc/  { print }

would only print lines that contained the string ''abc''.

Lines are split into fields separated by whitespace - $1 is the first field; $2 the second ...
and $0 is the whole line. Comments can follow the # symbol.

#  print those lines where "awk" appears in the first field.
$1 ~ /awk/  { print $0; }

An omited pattern matchs every line and an omitted action just prints the line.
The special pattern ''END'' is done after all data is read; so to print the sum of the first column:

{ sum = sum + $1  }
END { print sum }

To also find the maximum value of field $1:

{ sum = sum + $1 }
$1 > max  { max = $1 }
END{ print "sum = " sum;
     print "max value = " max; }

For terse concise summary see:
http://www.cs.princeton.edu/courses/archive/spring12/cos333/awk.help
most Extensive list: AwkChannelWiki: Index of all pages