I use this to quickly look up Linux commands I run frequently but don't want to remember or type. It greps for whatever word you type after "cheat". My cheatsheet file is included as a starting point, but feel free to modify it or use your own as you see fit.
- Copy these files to a local directory. For exaple:
mkdir ~/.cheatsheet && cd ~/.cheatsheet && git clone https://github.com/c0reysc0tt/bashCLIcheatsheet.git .
- Copy the contents of of the included .bashrc snippet to your own .bashrc, .bash_profile or .zshrc file. For example:
cat .bashrc >> ~/.bashrc && source ~/.bashrc
or:
cat .bashrc >> ~/.zshrc && source ~/.zshrc
- Make sure the
CHEATDIR
variable matches the location where you cloned the repo. - If you plan to use your cheatsheet on multiple systems but don't want to use Git, consider putting it in a folder that autopmatically syncs with a cloud storage service like Dropbox or Google Drive.
- The
thecheat
function is optional. See below for additional dependencies and usage.
Use cheat <word>
to search the cheatsheet for a word. Results will look like this:
To have your results delivered by a colorful ASCII version of The Cheat from Homestar Runner, type thecheat <word>
instead. This requires that both cowsay and lolcat are installed, and you'll need to copy the included thecheat.cow file into your cowsay cows folder (or make a link to it in your cows folder). On my Mac, it looks like this:
ln -s ~/.cheatsheet/thecheat.cow /usr/local/Cellar/cowsay/3.04/share/cows/thecheat.cow
You can quickly edit the cheatsheet file using vicheat
. I chose that name to follow the same convention as visudo, but you can edit the alias in the .bashrc file if something else makes more sense to you.