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 |
![](/var/linux_magazin/storage/images/issues/2022/265/atuin/figure-7/813078-1-eng-US/Figure-71_large.png)
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.
![](/var/linux_magazin/storage/images/issues/2022/265/atuin/figure-8/813081-1-eng-US/Figure-81_large.png)
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.
![Learn More](https://www.linux-magazine.com/var/linux_magazin/storage/images/media/linux-magazine-eng-us/images/misc/learn-more/834592-1-eng-US/Learn-More_medium.png)
News
-
NVIDIA Released Driver for Upcoming NVIDIA 560 GPU for Linux
Not only has NVIDIA released the driver for its upcoming CPU series, it's the first release that defaults to using open-source GPU kernel modules.
-
OpenMandriva Lx 24.07 Released
If you’re into rolling release Linux distributions, OpenMandriva ROME has a new snapshot with a new kernel.
-
Kernel 6.10 Available for General Usage
Linus Torvalds has released the 6.10 kernel and it includes significant performance increases for Intel Core hybrid systems and more.
-
TUXEDO Computers Releases InfinityBook Pro 14 Gen9 Laptop
Sporting either AMD or Intel CPUs, the TUXEDO InfinityBook Pro 14 is an extremely compact, lightweight, sturdy powerhouse.
-
Google Extends Support for Linux Kernels Used for Android
Because the LTS Linux kernel releases are so important to Android, Google has decided to extend the support period beyond that offered by the kernel development team.
-
Linux Mint 22 Stable Delayed
If you're anxious about getting your hands on the stable release of Linux Mint 22, it looks as if you're going to have to wait a bit longer.
-
Nitrux 3.5.1 Available for Install
The latest version of the immutable, systemd-free distribution includes an updated kernel and NVIDIA driver.
-
Debian 12.6 Released with Plenty of Bug Fixes and Updates
The sixth update to Debian "Bookworm" is all about security mitigations and making adjustments for some "serious problems."
-
Canonical Offers 12-Year LTS for Open Source Docker Images
Canonical is expanding its LTS offering to reach beyond the DEB packages with a new distro-less Docker image.
-
Plasma Desktop 6.1 Released with Several Enhancements
If you're a fan of Plasma Desktop, you should be excited about this new point release.