
Summary
- The history command stores and displays previous commands, but Atuin enhances this with cross-host sync and a powerful interface.
- Atuin replaces the default history functionality, improving navigation and search through a TUI and advanced features.
- Atuin can be easily installed and customized, offering context-specific history, stats, and many configurable options.
Spending all day tapping those arrow keys in the terminal looking for previous commands? We’ve all been there, but your experience can be better if you use this handy utility.
What’s Wrong With the history Command?
The history command keeps a record of other commands that you run in a shell. It can display a list of the commands you’ve previously run, and lets you manage that list.
Linux provides other commands and shortcuts to use this list. For example, !22 replays the command that’s numbered 22 in the history. The Up and Down arrows will, typically, navigate backward and forward through the history, displaying each command until you press Enter to replay one. Ctrl+R performs a history search.
Fittingly, the history command has been around for a long time. It was introduced in 1979 and became more widely used from 1989 on, when the Bash shell launched. As a result, it’s a mature tool that embodies the Unix philosophy of doing one thing, well. But it’s not without flaws.
While there are many commands to work with your history, they are all quite basic. Navigation and search happens one line at a time, so can be tricky to work with. And the way that history works across shells can be confusing. Open a new terminal, and it won’t have access to the history of your previous one—until you close that previous terminal, that is!

Related
How to Use the history Command on Linux
Better than typing it in manually three times.
How Does Atuin Work, Then?
Atuin is a program that aims to improve Linux’s default history, with cross-host sync, a TUI interface, detailed statistics, and more.
By default, Atuin takes control of the Up arrow to present its own view of your history. Like me, you may have the Up > Enter sequence—to instantly rerun your previous command—committed to muscle memory. If so, it may take a while to get used to Atuin’s interface appearing when you do this, but the same command sequence will still do the exact same thing: rerun your last command.
This full-screen view of your history can take a bit of getting used to, but once you’re familiar with Atuin’s features, it becomes more accessible. The tool is easy to install and quick to set up and start using, so the best way of learning about it is by trying it out.
To install Atuin, follow the instructions here. The quickest installation method is this command:
curl --proto '=https' --tlsv1.2 -LsSf https://setup.atuin.sh | sh
This command downloads a shell script and runs it. Using curl like this carries a small risk, which you can avoid by dropping the | sh. This will download the file which you can then inspect for your own peace of mind.
The script will install Atuin inside your home directory and update your startup script (e.g. ~/.bashrc) to run it. When you re-source that file, restart your terminal, or open a new tab/window, Atuin will be enabled.
You can use other package managers like Cargo, Homebrew, or Pacman to install Atuin, but doing this requires additional manual setup.
If you get an error like “curl: (23) client returned ERROR on write”, try installing curl using apt instead of snap. This solved the problem for me, on Ubuntu.
How Can Atuin Help Me?
Despite its narrow task, Atuin has quite a large set of features and can be a bit daunting at first. I recommend taking it slowly and experimenting with Atuin while you use it.
Basic Usage
Once you’ve installed Atuin, you can open its TUI interface by pressing the Up arrow. At first, you’ll see an empty screen since you have no history:
If you want, you can import your standard history with a simple command:
atuin import auto
Once you have some commands in your history, you can navigate the TUI using Up and Down arrows to select a command you want to replay. This will often be the command you last ran which will be the currently selected one by default, at the bottom of the list.
With a command selected, press either Enter to run it straight away or Tab to insert it on your command line, ready for editing. If you accidentally open Atuin, you can quit it by pressing Esc—or the Down arrow if you’re already at the bottom of the list.
Search
Chances are, you’re looking for a command with a specific name or one involving a specific file. In either case, just start typing to search the history list and refine your options:
Your search will appear at the bottom of the terminal, as you type, and Atuin will filter the history list it displays accordingly.
This is a fuzzy search, so you may get close matches as well as exact, literal results. You can also search using * as a wildcard, but I haven’t found this particularly necessary.
Configuration
Atuin is highly configurable, with many settings to control its behavior. Check out the ~/.config/atuin/config.toml file which has excellent comments along with each setting. I made a few small tweaks to the config when I started using Atuin and these have served me well.
First, if you don’t like the default fuzzy search, you can change it to search for a literal string anywhere in each command:
search_mode = "fulltext"
The TUI interface will clear your screen after use and can be a bit too intrusive. This is less of a problem if you use a full-screen terminal, but you can also reduce the number of lines Atuin uses to workaround this issue:
inline_height = 10
A great example of Atuin’s power is its context-specific history. You can use this feature to view previous commands you ran only in the current session or only in the current directory, among other options. Atuin displays the current filter mode in the bottom left: e.g. “[ GLOBAL ]” by default. You can press Ctrl-r to cycle through the modes, but you can also change the default based on how you invoke Atuin:
filter_mode_shell_up_key_binding = "directory"
This setting instructs Atuin to default to just the commands you ran in the current directory, when you open it by pressing the Up arrow. Opening Atuin with Ctrl-r will use the default filter, however, so this is a great way of having two modes easily accessible. It’s also another example of how configurable the tool is.
Sync
While synchronization is entirely optional, Atuin encourages it so that you can share your history across hosts. If you regularly ssh into remote hosts, this may be useful, especially if you carry out the same kind of tasks on them.
Personally, I haven’t felt the need to use sync, but it’s an impressive feature that is one of the major complaints leveled against the default history command.

Related
How to Connect to an SSH Server from Windows, macOS, or Linux
SSH is available on every popular operating system.
Statistics
If you’re ever interested in what kinds of commands you’re running, Atuin’s statistics will be of interest. You can view stats for your complete history or any specific 24-hour period:
Atuin’s default history list shows the time each command took to run. This is valuable information if you often start long-running processes like compiling software or analyzing disk usage with du. It also includes interactive commands like vim, so you can see how long you spent editing a file on a particular day.
Atuin also makes this information available in its Inspect view which shows details of a specific command, including how many times you run it per day and how many times it’s returned each exit status:
The inspector notes that it is a work in progress, but it’s worth bearing in mind that Atuin is actively maintained, with a host of contributors making changes on a regular basis.
Source link