There is a very simple command called numsum
to do this:
numsum -c FileName
-c --- Print out the sum of each column.
For example:
cat FileName
1 4 7
2 5 8
3 6 9
Output :
numsum -c FileName
6 15 24
Note:
If the command is not installed in your system, you can do it with this command:
apt-get install num-utils
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…