Operations 8 min read

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.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Master Your Shell History with Atuin: Install, Sync, and Powerful Search

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 sync

Shell integration

zsh

echo 'eval "$(atuin init zsh)"' >> ~/.zshrc
# or with a plugin manager
zinit load ellie/atuin

bash

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)"' >> ~/.bashrc

fish

atuin init fish | source
# add the line to ~/.config/fish/config.fish inside the is-interactive block

Common 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" cargo

Sync 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
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

ShellencryptionSQLitesynccommand-lineatuin
Liangxu Linux
Written by

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.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.