ADDING COLUMNS QUICKLY

If you have a file with multiple
columns

1 5
5 7
2 7
9 2

and you want to add up a
specific column, the following
command can be used:

$ awk -v col=2 '{ total += $col } END { print total }' FILENAME

Where "col=2" is the second column in the file. NOTE: All tips provided are USE AT YOUR OWN RISK. Tips are submitted
by various unix admins around the globe. UGU suggest you read and
test each tip in a non-volitile environment before placing into
production.