Master Your Shell History with Atuin: Install, Sync, and Powerful Search
Atuin replaces the traditional shell history with a SQLite‑backed, feature‑rich UI, offering encrypted synchronization across machines, detailed command metadata, and flexible search capabilities, while providing multiple installation methods and shell plugin integrations for zsh, bash, and fish.
Overview
Atuin stores shell command history in a SQLite database, adding metadata such as exit code, current working directory, hostname, session identifier, and command duration. It provides a full‑screen terminal UI for browsing and searching history, and can optionally synchronize history across machines with end‑to‑end encryption, either using the public server ( https://api.atuin.sh) or a self‑hosted instance.
Key Features
Full‑screen history search UI bound to up and ctrl‑r SQLite‑based storage of shell history
End‑to‑end encrypted backup and sync
Consistent history across terminals, sessions, and machines
Records exit code, cwd, hostname, session, and command duration
Statistics such as most used commands
Does not replace the original history file
Quick jump to previous entries via Alt‑<num> Filter mode toggle with ctrl‑r (session, directory, global)
Supports zsh, bash, and fish shells
Installation
Script (recommended)
bash <(curl https://raw.githubusercontent.com/ellie/atuin/main/install.sh)Do not run the script as root.
Package managers
Cargo : cargo install atuin (requires rustup)
Homebrew : brew install atuin MacPorts : sudo port install atuin Pacman : pacman -S atuin From source :
git clone https://github.com/ellie/atuin.git
cd atuin
cargo install --path .Sync server registration (optional)
atuin register -u USERNAME -e EMAIL -p PASSWORD
atuin import auto
atuin syncShell integration
zsh
echo 'eval "$(atuin init zsh)"' >> ~/.zshrc
# or with a plugin manager
zinit load ellie/atuinbash
curl https://raw.githubusercontent.com/rcaloras/bash-preexec/master/bash-preexec.sh -o ~/.bash-preexec.sh
echo '[[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh' >> ~/.bashrc
echo 'eval "$(atuin init bash)"' >> ~/.bashrcfish
atuin init fish | source
# add the line to ~/.config/fish/config.fish inside the is-interactive blockCommon commands
atuin search <query>– search history (supports * and % wildcards). Options: --cwd / -c: filter by directory. --exclude-cwd: exclude a directory. --exit / -e: filter by exit code. --exclude-exit: exclude a specific exit code. --before / --after: time‑range filters. --interactive / -i: open interactive TUI. --human / -h: human‑readable timestamps and durations. atuin sync – manually trigger synchronization.
Example searches:
# Interactive TUI search
atuin search -i
# Successful cargo commands
atuin search --exit 0 cargo
# Commands before 01/04/2021 in current directory that failed
atuin search --exclude-exit 0 --before 01/04/2021 --cwd .
# Commands after "yesterday 3pm" that succeeded
atuin search --exit 0 --after "yesterday 3pm" cargoSync server
Run atuin server start to host a private sync server. The default public server is https://api.atuin.sh. All data is end‑to‑end encrypted, so the server operator cannot read your history.
Account and encryption key
After registration, Atuin generates an encryption key stored in ~/.local/share/atuin. Retrieve it with atuin key. Never share this key.
GitHub repository: https://github.com/ellie/atuin
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Liangxu Linux
Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
