Skip to content

Statistics

Outcome: you can ask the database what you actually do all day — the commands you run most, overall or on a given day — and you know which of the printed numbers to trust. Check: the two runs below are transcript t05-stats.txt, against the lab's 35 commands.

The shape of your day

atuin stats

counts your history by command — roughly, the first word (it is smarter than that in two ways: a leading sudo is unwrapped, so sudo apt install … counts under apt install, and a two-word tool like systemctl status keeps both words). The output is a bar chart with totals:

$ atuin stats --count 8
[▮▮▮▮▮▮▮▮▮▮] 4 cd
[▮▮▮▮▮     ] 2 cat
[▮▮▮▮▮     ] 2 tar
[▮▮▮▮▮     ] 2 ls
[▮▮▮▮▮     ] 2 mkdir
[▮▮        ] 1 whoami
[▮▮        ] 1 systemctl status
[▮▮        ] 1 du
Total commands:   35
Unique commands:  36

--count N sets how many bars print (the default is 10). In the lab, cd wins at 4 — one from the imports, three from the live session — which is the usual truthful answer on any machine: navigation outruns action.

A single day

Give stats a date and it counts only that day:

$ atuin stats 2026-10-28 --count 5
[▮▮▮▮▮▮▮▮▮▮] 3 cd
[▮▮▮       ] 1 sleep
[▮▮▮       ] 1 tar
[▮▮▮       ] 1 grep
[▮▮▮       ] 1 echo
Total commands:   13
Unique commands:  14

Thirteen — the live session, exactly. On your own machine this is the end-of-day question (what did today actually consist of?) and the timesheet question nobody enjoys reconstructing from memory. Word-shaped periods exist in the documentation (day, week, month); in the lab's build the dated form above is the one that answered reliably — day and week returned empty — so this chapter teaches the dated form and the verification notes in criteria.md record the discrepancy.

An honest footnote about "Unique"

Look again at those totals: 35 commands, 36 unique. A database cannot hold more distinct commands than commands. Chapter 9 counts the lab's database directly and finds 34 distinct command texts in 35 rows (one command, cd ~, ran twice). Atuin's own unique counter is, in this build, simply wrong by a little.

The bars and the total agree with the database; the unique line does not — it disagrees with the direct count the next chapter makes, and the lab could not find the rule the counter follows. Trust the bars, verify the rest — that order of operations is most of what this series exists to teach, and it applies to the tools it praises exactly as much as to the ones it doesn't. atuin stats remains the quickest portrait of a shell habit available; just read its footer with one eyebrow up, the way chapter 9 will teach you to read everything — including Atuin.