Column Statistics With datamash

Compute mean, median, deviation and more on tabular text input.

macOStextstatscsvLow risk
Run seq 1 10 | datamash mean 1 sstdev 1 to print the mean and sample deviation.

01Command

Command
$ seq 1 10 | datamash mean 1 sstdev 1

02What it does

datamash performs statistical and grouping operations from the shell: mean, median, sum, variance, percentiles and cross-tabulation. It is a fast way to summarise CSV or TSV columns without writing a script.

03Risk

RiskLow risk
CompatibilitymacOS with Homebrew installed
!Warning: It assumes column-oriented whitespace or tab-separated input by default; use --header-in and field flags for other layouts.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • Homebrew formula: datamash
    Homebrew · vendor-doc · 2026-09-20
    Evidence: Tool to perform numerical, textual & statistical operations. GNU datamash computes descriptive statistics and grouping operations on text tables.
  • Official project documentation
    Official project · vendor-doc · 2026-09-20
    Evidence: GNU datamash computes descriptive statistics and grouping operations on text tables.

Last verified: 2026-09-22 · Category: Developer