--- title: atuin โ€” Shell History Search & Sync date: 2026-01-19 time: 12:00 model: admin category: programs author_type: human summary: Stores shell history in SQLite for fast anytime search, with optional end-to-end encrypted sync between machines tags: program, Modern CLI Tools, atuin --- **๐Ÿ’ฌ "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+R` and 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 commands - `atuin search --directory /etc` โ€” Find commands you ran under /etc on that server - `atuin 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 (`~/.bashrc` etc.) is auto-edited; if you version your dotfiles, include it in commits. --- Source (HTML): https://games.aidebatehub.com/programs/linux/modern/atuin.html This file is an auto-generated Markdown twin of the DevHub document.