Your Shell History Deserves Better
Your shell history is probably a mess. I know mine was. Thousands of lines in .bash_history with no way to search through them. Atuin fixes that. It replaces your plain text history with a SQLite database you can search, sync across machines, and keep forever.
Atuin shell history captures every command you type and stores it with full metadata. You search by directory, by time range, or with regex patterns. I have been using it for months and it changed how I work in the terminal.
What Is Atuin Shell History
Atuin shell history is an open source replacement for your existing shell history. It works with bash, zsh, and fish. The project lives on GitHub and gets regular updates. Think of it as the difference between digging through a pile of receipts and searching a well-organized spreadsheet.
Your default shell history stores commands in plain text with no indexes and no useful timestamps. It gets truncated when it gets too big. Atuin stores every command with the working directory, the exact timestamp, and the exit code. Then it gives you a search interface that actually works.
Installing Atuin on Linux
Installation is straightforward. Atuin provides a shell script installer and packages for most distributions. I used the cargo approach since I already had Rust installed.
# Using the official install script
curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh
# Or with cargo if you have Rust
cargo install atuin
After installation, add the hook to your shell config file:
# For bash, add to ~/.bashrc
echo 'eval "$(atuin init bash)"' >> ~/.bashrc
# For zsh, add to ~/.zshrc
echo 'eval "$(atuin init zsh)"' >> ~/.zshrc
Restart your shell or source the config file. Atuin starts recording every command you type from that point on. Your existing history imports automatically the first time you run it.
5 Features That Make Atuin Shell History Worth Using
1. Search with ctrl-r
The default reverse search in bash is painful. You press ctrl-r, type a few characters, and cycle through matches one at a time. Atuin replaces that with a full-screen interactive search that shows multiple results at once.
Press ctrl-r in your terminal and Atuin opens a search window. You see the command, the directory it was run in, and when it ran. Type part of a command to filter live. Use arrow keys to pick the right one and press enter. This alone makes Atuin shell history worth installing.
You can also filter by directory. If you only want commands you ran in /var/log, add the directory filter. Atuin shows only the relevant results.
2. Sync history across machines
This is the feature that sold me. Atuin shell history can sync across all your machines using their hosted service or your own server. I work on three different machines and my history follows me everywhere.
Set up syncing with an encryption key so your commands stay private:
atuin register -u -e
atuin login -u
atuin sync
Now every command I run on my laptop shows up on my desktop. When I am troubleshooting a server at 2 AM and remember I fixed something similar last week on my other machine, I search and the command is there.
3. Search by exit code
Atuin records the exit code of every command. You can search for commands that failed and commands that succeeded separately. I use this constantly when debugging.
# Find successful commands
atuin search --exit 0
# Find failed commands
atuin search --failed
You also see the exit code in search results. If a command failed before, you know before you run it again. This saved me from running a bad rm command more than once.
4. Tag and organize commands
Atuin lets you tag commands for later. When I find a useful one-liner or a complex pipeline I will need again, I tag it. This is better than saving a blog post because the command actually works in my environment.
# Tag the last command
atuin tag --add "backup"
# Search by tag later
atuin search --tag backup
I tag deployment commands, database queries, and awk one-liners I never remember. Having them searchable by tag is faster than scrolling through notes.
5. Stats and insights
Atuin shell history shows you stats about your command usage. You can see which commands you run most often and when you are most productive.
# Show your most used commands
atuin stats
I discovered I was typing git status dozens of times a day. I added an alias and cut my typing significantly. The stats also confirmed I am most productive in the morning, which was nice to see confirmed.
Practical Atuin Workflows
Here are a few things I do daily with Atuin shell history:
Recovering a lost command. You ran something complex an hour ago and cannot remember the exact flags. Press ctrl-r, type a keyword, and it shows up.
Reusing a command from a different directory. You ran a docker command in /project and now you are in /home. Atuin shell history shows you the command regardless of where you are right now.
Finding commands from yesterday. Filter by date range:
atuin search --after "yesterday" --before "today" | head -20
How Atuin Compares to Other Tools
There are other history tools like bash-history and zsh-history-substring-search. But Atuin shell history is different because it stores everything in a real database with proper indexes. It does not truncate or rotate. It syncs. And the search is genuinely fast.
If you already use fzf or ripgrep for file searching, Atuin fills the same role for your command history. It is the kind of tool that feels unnecessary until you use it for a week, and then you cannot go back.
Getting Started
The Atuin documentation covers advanced features like self-hosted sync servers and encryption keys. Check the official Atuin docs for the full picture: docs.atuin.sh. The source code and issue tracker are on GitHub.
You can also pair Atuin shell history with fzf for even faster searches. I wrote about fzf setup on Linux if you want to explore that combination. And if you are upgrading your terminal workflow, check out my guide on eza as an ls replacement. For fast file searching, see the ripgrep tutorial.
Give Atuin a try for a week. Install it, let it build up some history, and then try searching without it. You will see the difference.