====== Sum values of all lines from a file/output ====== awk '{s+=$1} END {print s}' mydatafile Can be used also with | grep "whatever" mydatafile | cut | … | awk '{s+=$1} END {print s}'