Compute the total of a numeric CSV field after skipping the header.
Section: Practical Recipes
Sum a CSV column
bash
bash
awk -F, 'NR>1 {sum += $3} END {print sum}' sales.csvExplanation
Great for quick ad hoc analysis without opening a spreadsheet.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Practical Recipes
Show most frequent error messages
Count and rank repeated lines in a log.
Show effective config lines only
Remove comments and blank lines from a config file.
Replace text across many files safely
Search files first, then edit in place.