How often do you find yourself scratching your head, trying to remember a command that you knew by heart but just can’t remember when you need it most?

It happens to me quite often. Probably because I am aging or may be there is too much stuff in my brain attic.

But I found a solution to that and it’s called Cheat.

Cheat is a beautiful light weight piece of software .. Here is the excerpt from the Github documentation page for what it does.

“Cheat allows you to create and view interactive cheat sheets on the command-line. It was designed to help remind *nix system administrators of options for commands that they use frequently, but not frequently enough to remember.”

Cheat comes with a big list of *nix cheat sheets for all the basic commands, so it’s usable and useful out of box and that’s good news :). The great news is that you can extend it very easily from the CLI. I personally use it on a MAC and Linux and it’s working like a charm.

I basically try to get myself into the habit of creating such sheets for whatever operations I do from time to time but not regular enough to keep them fresh in my mind.

Cheat is python based but I it was also ported to different languages as well. Check out the documentation on github page here https://github.com/chrisallenlane/cheat but below is my quick guide.

Installing cheat:

To install cheat, you can clone the Github repository or just use pip to install the python version as below

[wael-lt:~/workspace] wael% sudo pip install cheat

List available cheat sheets:

You have a ton here to start with, start adding your networking ones and make it yours.

[wael-lt:~/workspace] wael% cheat -l 7z /Library/Python/2.7/site-packages/cheat/cheatsheets/7z ab /Library/Python/2.7/site-packages/cheat/cheatsheets/ab apk /Library/Python/2.7/site-packages/cheat/cheatsheets/apk apparmor /Library/Python/2.7/site-packages/cheat/cheatsheets/apparmor apt /Library/Python/2.7/site-packages/cheat/cheatsheets/apt apt-cache /Library/Python/2.7/site-packages/cheat/cheatsheets/apt-cache apt-get /Library/Python/2.7/site-packages/cheat/cheatsheets/apt-get aptitude /Library/Python/2.7/site-packages/cheat/cheatsheets/aptitude ..... output truncated......

show specific cheat sheet:

[wael-lt:~/workspace] wael% cheat vim # File management :e reload file :q quit :q! quit without saving changes :w write file :w {file} write new file :x write file and exit

Edit or Create a new cheat sheet:

you just need to set your EDITOR environment variable for whatever texteditor you are using.

[wael-lt:~/workspace] wael% export EDITOR=nano [wael-lt:~/workspace] wael% cheat -e

Getting help:

[wael-lt:~/workspace/] wael% cheat --help cheat Usage: cheat cheat -e cheat -s cheat -l cheat -d cheat -v

I like simple things and cheat is one simple thing that I love and is giving my memory a boost. Give it a try yourself.

Other implementations:

/chrisallenlane/cheat in Python

/jahendrie/cheat in Bash

/lucaswerkmeister/cheats in Bash

/defunkt/cheat in Ruby

/torsten/cheat in Ruby (single file)

/arthurnn/cheatly in Ruby