Sum a column with awk
Sum values in column 2 of a text file
awk '{sum += $2} END {print sum}' file.txt
More linux commands
-
sed -i '/^#/d' config.confRemove all comment lines starting with #
-
sed -n '/START/,/END/p' file.txtPrint block of text between START and END markers
-
sort file.txt | uniq -c | sort -rnCount occurrences of each unique line
-
who -H && wActive user sessions and what they are running
-
last -n 20 | head -25Last 20 login records with IP and duration