awk '{s+=$1} END {print s}' mydatafile
Can be used also with |
grep "whatever" mydatafile | cut | … | awk '{s+=$1} END {print s}'