Last Updated on May 28, 2022
This is the third in our series of articles highlighting essential system tools. These are small utilities, useful for system administrators as well as regular users of Linux based systems. The series examines both graphical and text based open source utilities.
The first tools under the spotlight were ps_mem, a small utility that accurately reports memory consumption of software, and gtop, a system monitoring dashboard.
This time, we’ll take a look at pet, a simple command-line snippet manager. The software is written in the Go programming language.
A command-line interface allows the user to interact with the computer by typing in commands. The computer displays a prompt, the user keys in the command and presses enter or return.
Installation
These days I usually gravitate to installing software by compiling the source code. First clone the repository, and try to compile.
cd pet
make install
The make install failed on my system as my system was missing dep, a tool for managing dependencies for Go projects. The steps taken to install dep were:
export GOPATH=/home/sde/gocode
go get github.com/golang/dep/cmd/dep
This creates a binary in /home/sde/golang/bin/. I also added the directory to the PATH environment.
Packages are available for popular Linux distributions including Debian, Ubuntu, RedHat, and others. For example, there’s a package available for pet in the Arch User Repository.
In operation
At a shell, typing ‘pet’ or ‘pet –help’ shows the available options.
For each snippet you can add a detailed description of what the command does, which acts as a useful aide-memoire.
Features of pet include:
- Register your command snippets easily using pet new.
- Easily edit snippet files.
- List all your snippets.
- Use variables (
<param>
or<param=default_value>
) in snippets. - Search snippets interactively.
- Run snippets directly.
- Edit snippets easily (the snippets are managed in a TOML1 file).
- Sync and share snippets via Gist or GitLab Snippets automatically.
Summary
If you’re like me, you often forget useful commands, particularly ones with lots of flags. You can create aliases or use the history command combined with grep to alleviate this issue. But pet arguably offers a slicker way, as it lets you search the snippets to quickly find what you need.
Website: github.com/knqyf263/pet
Support:
Developer: Teppei Fukuda
License: MIT License
1 TOML is a configuration file format that’s intended to be easy to read due to more obvious semantics which aims to be “minimal”.
pet is written in Go. Learn Go with our recommended free books and free tutorials.
All the essential tools in this series:
Essential System Tools | |
---|---|
Alacritty | Innovative, hardware-accelerated terminal emulator |
BleachBit | System cleaning software. Quick and easy way to service your computer |
bottom | Graphical process/system monitor for the terminal |
btop++ | Monitor usage and stats for CPU, memory, disks, network and processes |
catfish | Versatile file searching software |
Clonezilla | Partition and disk cloning software |
CPU-X | System profiler with both a GUI and text-based |
Czkawka | Find duplicate files, big files, empty files, similar images, and much more |
ddrescue | Data recovery tool, retrieving data from failing drives as safely as possible |
dust | More intuitive version of du written in Rust |
f3 | Detect and fix counterfeit flash storage |
Fail2ban | Ban hosts that cause multiple authentication errors |
fdupes | Find or delete duplicate files |
Firejail | Restrict the running environment of untrusted applications |
Glances | Cross-platform system monitoring tool written in Python |
GParted | Resize, copy, and move partitions without data |
GreenWithEnvy | NVIDIA graphics card utility |
gtop | System monitoring dashboard |
gWakeOnLAN | Turn machines on through Wake On LAN |
hyperfine | Command-line benchmarking tool |
HyFetch | System information tool written in Python |
inxi | Command-line system information tool that's a time-saver for everyone |
journalctl | Query and display messages from the journal |
kmon | Manage Linux kernel modules with this text-based tool |
Krusader | Advanced, twin-panel (commander-style) file manager |
Nmap | Network security tool that builds a "map" of the network |
nmon | Systems administrator, tuner, and benchmark tool |
nnn | Portable terminal file manager that's amazingly frugal |
pet | Simple command-line snippet manager |
Pingnoo | Graphical representation for traceroute and ping output |
ps_mem | Accurate reporting of software's memory consumption |
SMC | Multi-featured system monitor written in Python |
Timeshift | Reliable system restore tool |
QDirStat | Qt-based directory statistics |
QJournalctl | Graphical User Interface for systemd’s journalctl |
TLP | Must-have tool for anyone running Linux on a notebook |
Unison | Console and graphical file synchronization software |
VeraCrypt | Strong disk encryption software |
Ventoy | Create bootable USB drive for ISO, WIM, IMG, VHD(x), EFI files |
WTF | Personal information dashboard for your terminal |