I used this in the bash terminal to get the mean in a humongous file:

`awk 'BEGIN{s=0;}{s=s+$2;}END{print s/NR;}' file`

It worked. Just out of curiosity (i.e. for future knowledge) I would like to know about common ways to calculate in the shell. R, bash, python...? Quick and dirty but still robust and fast.