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
-
New Slimbook EVO with Raw AMD Ryzen Power
If you're looking for serious power in a 14" ultrabook that is powered by Linux, Slimbook has just the thing for you.
-
The Gnome Foundation Struggling to Stay Afloat
The foundation behind the Gnome desktop environment is having to go through some serious belt-tightening due to continued financial problems.
-
Thousands of Linux Servers Infected with Stealth Malware Since 2021
Perfctl is capable of remaining undetected, which makes it dangerous and hard to mitigate.
-
Halcyon Creates Anti-Ransomware Protection for Linux
As more Linux systems are targeted by ransomware, Halcyon is stepping up its protection.
-
Valve and Arch Linux Announce Collaboration
Valve and Arch have come together for two projects that will have a serious impact on the Linux distribution.
-
Hacker Successfully Runs Linux on a CPU from the Early ‘70s
From the office of "Look what I can do," Dmitry Grinberg was able to get Linux running on a processor that was created in 1971.
-
OSI and LPI Form Strategic Alliance
With a goal of strengthening Linux and open source communities, this new alliance aims to nurture the growth of more highly skilled professionals.
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.