Skip to content

A simple reference tool for maintaining and searching a cheatsheet for bash commands

Notifications You must be signed in to change notification settings

c0reysc0tt/bashCLIcheatsheet

Repository files navigation

bash CLI cheatsheet

A reference tool for maintaining and searching a cheatsheet for bash commands

Summary:

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.

Setup:

  1. Copy these files to a local directory. For exaple:
mkdir ~/.cheatsheet && cd ~/.cheatsheet && git clone https://github.com/c0reysc0tt/bashCLIcheatsheet.git .
  1. 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

.bashrc notes:

  • 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.

Usage:

Use cheat <word> to search the cheatsheet for a word. Results will look like this:

alt text

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

alt text

Editing the cheatsheet:

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.

I hope this is useful to some people out there, and I welcome your feedback! Happy cheating!

About

A simple reference tool for maintaining and searching a cheatsheet for bash commands

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages