atuin — Shell History Search & Sync
Linux / Modern CLI Tools / atuin.html
💬 "atuin command"
atuin is a tool that replaces your shell history with a SQLite database. Instead of a flat history file, it stores commands with directory, exit code, and timestamp so you can search them quickly anytime.
Written in Rust, it optionally syncs your history between machines with end-to-end encryption (E2E). It upgrades your shell's default Ctrl+R search into a powerful interactive search.
- Concept: Stores shell history in SQLite with command, directory, and timestamp.
- Features: Full-history search, directory/user filters, statistics, and encrypted sync between machines.
- Strength: Find past commands instantly with
Ctrl+Rand reuse them across servers. - Use when: You need to recall "that command I ran on that server the other day."
Basic Usage
After install, atuin integrates into your shell so you keep your usual search key but get far better search.
1. Register / login → shell integration
On first run it creates an account and automatically integrates into your shell config.
atuin register --username myuser --email me@example.com
atuin login
atuin import # import existing history
2. Searching (Ctrl+R)
Now press Ctrl+R as usual to open the interactive search UI. Arrow keys to move, Enter to run, Esc to cancel.
# Ctrl+R to search, or search from the command line
atuin search "docker ps"
atuin search --directory /var/log
3. Stats and sync
Check history size and sync between machines.
atuin stats
atuin sync # sync with server
atuin history list # list recent history
Installation & Download
atuin installs via the official script, cargo, or a package manager.
| Environment | Command |
|---|---|
| Official installer (Linux/macOS) | curl -LsSf https://atuin.sh/install.sh | sh |
| cargo | cargo install atuin |
| Ubuntu/Debian (package) | sudo apt install atuin |
| macOS (Homebrew) | brew install atuin |
Verify with atuin --version. Shell integration is added by atuin init output in your shell rc file, or automatically at registration.
Common Commands
| Command / Key | Description |
|---|---|
atuin search "keyword" | Search the full history for a command |
atuin search --directory ~/proj | Search only commands run in a specific directory |
atuin stats | Show most-used commands and directories |
atuin sync | Sync history with the server |
atuin import | Import existing bash/zsh history |
3 Essential Command Combinations
atuin search "git" | head— Collect past git commandsatuin search --directory /etc— Find commands you ran under /etc on that serveratuin stats | head— See the commands you use most
💬 "Using atuin on a real server"
A step-by-step look at recalling a command you forgot on a production server.
Step 1 · Import history
Move existing history into atuin.
atuin import && atuin stats
Step 2 · Search a forgotten command
Find a deploy command from weeks ago.
atuin search "deploy"
Step 3 · Commands from one directory
Trace edits made to a config.
atuin search --directory ~/workspace
How it is used in practice
1. Reuse a long command
Situation — Find a complex rsync command from days ago.
atuin search "rsync --delete"
Result — The full past rsync command and its timestamp are shown together.
Point — Copy and rerun it to avoid typos and omissions.
2. Per-server history audit
Situation — Audit what was done on a specific server.
atuin search --directory /var/www
Result — Commands run in that path are listed with timestamps.
Point — Useful for incident forensics and work logs.
Caveats
- Machine sync needs an Atuin server account and stores history on an external server (encrypted, but pick public servers carefully).
- If you do not need sync, the local SQLite alone still gives full search.
- Your shell rc file (
~/.bashrcetc.) is auto-edited; if you version your dotfiles, include it in commits.