Cheatsheet Utility

It is often helpful to have a quick reference to a set of commands in a development environment. Some of them are hard to remember because they are not very common. Whether you’re working with system administration tools, programming utilities, or specialized Linux commands, trying to memorize complex syntax can be frustrating and time-consuming.

The Problem with Command Line Memory

As a developer or system administrator, you frequently encounter commands that you use irregularly. These commands may be complex with numerous flags and options, but you don’t use them often enough to commit them to memory. Man pages are helpful but can be verbose, and searching Stack Overflow becomes a regular habit.

Introducing the Cheat Utility

Fortunately, a developer identified this problem and created an elegant solution: the cheat utility. This is a command-line tool that allows you to create and access a personal database of cheatsheets for commands you frequently use or find difficult to remember.

The cheat utility provides several advantages:

  • Quick Access: Get instant command syntax without searching online
  • Community Contributed: Access thousands of community-maintained cheatsheets
  • Personal Collections: Create your own custom cheatsheets for frequently used commands
  • Searchable: Easily search through available cheatsheets by title or keyword
  • Offline: No internet connection required once cheatsheets are downloaded

Installing the utility

wget -c https://github.com/cheat/cheat/releases/download/4.2.3/cheat-linux-amd64.gz -O - | gunzip -d > /tmp/cheat
sudo mv /tmp/cheat /usr/local/bin/cheat
sudo chmod +x /usr/local/bin/cheat

Initializing the application

localhost $ cheat
A config file was not found. Would you like to create one now? [Y/n]: y
Would you like to download the community cheatsheets? [Y/n]: y
Cloning into '/home/user/.config/cheat/cheatsheets/community'...
remote: Enumerating objects: 1118, done.
remote: Counting objects: 100% (278/278), done.
remote: Compressing objects: 100% (33/33), done.
remote: Total 1118 (delta 256), reused 245 (delta 245), pack-reused 840
Receiving objects: 100% (1118/1118), 284.04 KiB | 2.45 MiB/s, done.
Resolving deltas: 100% (491/491), done.
Created config file: /home/user/.config/cheat/conf.yml
Please read this file for advanced configuration information.

Using the utility

localhost $ cheat curl
# To download a file:
curl <url>

# To download and rename a file:
curl <url> -o <outfile>
--- truncated output ---

Search cheatsheets with tile matching keyword mark

localhost $ cheat -l mark
title:                   file:                                                                     tags:
markdown                 /home/user/.config/cheat/cheatsheets/community/markdown                 community
vim-plugins/vim-markdown /home/user/.config/cheat/cheatsheets/community/vim-plugins/vim-markdown community

Display all available cheatsheets

localhost $ cheat -l
title:                    file:                                                                      tags:
7z                        /home/user/.config/cheat/cheatsheets/community/7z                        community,compression
ab                        /home/user/.config/cheat/cheatsheets/community/ab                        community
acl                       /home/user/.config/cheat/cheatsheets/community/acl                       community
--- truncated output ---

Best Practices and Tips

Creating Personal Cheatsheets

You can create your own custom cheatsheets to store commands specific to your workflow:

$ cheat -e mycommand

This will open your default editor (usually vim or nano) where you can add custom entries. Format your personal cheatsheets using the same structure as the community examples—clear comments followed by example commands.

Keeping Your Cheatsheets Updated

The community cheatsheets are regularly updated. To pull the latest changes:

$ cd ~/.config/cheat/cheatsheets/community
$ git pull

Filtering by Tags

You can search cheatsheets by their tags:

localhost $ cheat -l -t compression

This shows only cheatsheets tagged with “compression”, making it easier to find related commands.

Conclusion

The cheat utility is an invaluable tool for anyone who works regularly with the command line. Instead of relying on internet searches or trying to recall complex syntax, you have instant access to well-organized, community-vetted cheatsheets. Whether you’re a beginner learning new tools or an experienced sysadmin managing dozens of utilities, cheat can significantly improve your productivity and reduce cognitive load. Start building your personal cheatsheet collection today!