# Basic syntax:
awk '{var += $column_number} END{print var}' your_file.txt
# Where:
# - var is simply a variable that stores the growing sum as it gets
# incremented as the file gets processed line by line (i.e. "sum" isn't
# a special keyword or anything as might be implied by other answers)
# - += $column_number has awk add the value from column "column_number" to
# the growing sum stored in var. Note, by default any run of spaces
# and/or tabs and/or newlines are used to separate columns in awk
# - END is used to execute additional commands after all the input is read.
# Here, it prints the value of var to STDOUT
# Example usage:
# Say you have a TSV file with the following values and want the sum of the
# numbers in the third column:
a b 1 c
d e 1 f
g h 2 i
j k 3 l
m n 5 o
awk '{total += $3} END{print total}' your_file.tsv
# Note, with awk you can easily sum columns for which a condition is true, e.g.:
awk '{ if (NR>1 && NR<5) {total += $3}} END{print total}' your_file.tsv
# Where the above command gets the sum of column 3 for the 2nd-4th rows of
# the file