Awk — sum a column
Sum the 3rd column of a space-delimited text file
awk '{sum += $3} END {print sum}' file.txt
More linux commands
-
sed -i 's/old-string/new-string/g' file.txtIn-place global string replacement
-
sort file.txt | uniq -c | sort -rn | head -20Count and rank duplicate lines in a file
-
lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINT,UUIDTree of disks, partitions, loop devices with filesystem info
-
blkidPrint UUID, LABEL, and FSTYPE for all block devices
-
mount -t ext4 /dev/sdb1 /mnt/dataMount ext4 partition to /mnt/data