Tracking command history across multiple computers
Normal Search
If you pass in additional arguments to Atuin when you call it, you can filter for exit codes, among other things, which limits the results to commands that completed successfully. In addition, you can control the output by specifying the directories in which the commands were entered. The search can also be restricted to specific time periods (Figure 7). Table 1 shows some Atuin query examples. For more parameters, see the search
function documentation on GitHub [9].
Table 1
Atuin Query Examples
atuin -e (--exit) 1 |
Shows which entered commands were not allowed, typically because of missing permissions (see Table 2). |
atuin search --exclude-exit 1 |
Does the opposite of the above command. |
atuin search --exit 1 --after 01/07/2022 |
Displays commands that were entered after July 1, 2022, and were not executable. You can use the --before parameter in a similar way. |
atuin search --exit 0 --before 01/07/2022 --cwd . |
Displays commands that were successfully executed from the current directory (--cwd .) before July 1, 2022. |
atuin gen-completions --shell bash --out-dir ~/.config/atuin |
Creates a command completion (bash-completion) in the specified directory. |
curl https://api.atuin.sh/enable -d $(cat ~/.local/share/atuin/session) |
Creates an activity graph similar to the one for GitHub activities. |
Table 2
Exit Codes
Exit Code | Meaning |
---|---|
0 |
Success |
1 |
Operation not allowed |
2 |
No such directory |
3 |
No such process |
While it's a bit of a gimmick, the command
atuin stats all
prints an overall statistic and can be restricted to a specific day, for example, by typing
atuin stats day last friday
or by specifying a date (Figure 8). The last row in Table 1 shows how to create a GitHub-style activity graph. However, creating this graph requires registering with the public sync server or running your own server.
Conclusions
There are many tools that extend the basic history
function in different ways. First released in April 2021, Atuin focuses on synchronizing command sequences on different computers. You can use the results globally across all synchronized computers. However, you can also filter your results by computer, the current session, or the directory in which the commands were originally accessed.
Atuin's documentation is still a little sparse, but otherwise it does exactly what it should. Direct support for the tool is available from the Atuin channel on Discord [10], if needed. If you're interested in the way projects like this come about, you can discover more in an interview with Ellie Huxtable, the developer behind Atuin [11].
Infos
- Bash history: https://www.digitalocean.com/community/tutorials/how-to-use-bash-history-commands-and-expansions-on-a-linux-vps
- Atuin: https://github.com/ellie/atuin
- Debian package: https://github.com/ellie/atuin/releases/tag/v0.10.0
- Docker image: https://github.com/ellie/atuin/pkgs/container/atuin
- Docker Compose: https://github.com/ellie/atuin/commit/a9d1ece0cb2090b54668765f70ec00cd2b3a8554#diff-e45e45baeda1c1e73482975a664062aa56f20c03dd9d64a827aba57775bed0d3
- TOML: https://en.wikipedia.org/wiki/TOML
- Fuzzy search: https://github.com/ellie/atuin/blob/main/docs/config.md#fuzzy-search-syntax
- Filter mode: https://github.com/ellie/atuin/blob/main/docs/config.md#filter_mode
- search: https://github.com/ellie/atuin/blob/main/docs/search.md
- Atuin on Discord: https://discord.gg/Fq8bJSKPHh
- Interview with Ellie Huxtable: https://console.dev/interviews/atuin-ellie-huxtable/
« Previous 1 2
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
AlmaLinux 10.0 Beta Released
The AlmaLinux OS Foundation has announced the availability of AlmaLinux 10.0 Beta ("Purple Lion") for all supported devices with significant changes.
-
Gnome 47.2 Now Available
Gnome 47.2 is now available for general use but don't expect much in the way of newness, as this is all about improvements and bug fixes.
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.