- Notifications
You must be signed in to change notification settings - Fork0
cheat allows you to create and view interactive cheatsheets 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.
License
fpob/cheat
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
cheat
allows you to create and view interactive cheatsheets on thecommand-line. It was designed to help remind *nix system administrators ofoptions for commands that they use frequently, but not frequently enough toremember.
The next time you're forced to disarm a nuclear weapon without consultingGoogle, you may run:
cheat tar
You will be presented with a cheatsheet resembling:
# To extract an uncompressed archive:tar -xvf'/path/to/foo.tar'# To extract a .gz archive:tar -xzvf'/path/to/foo.tgz'# To create a .gz archive:tar -czvf'/path/to/foo.tgz''/path/to/foo/'# To extract a .bz2 archive:tar -xjvf'/path/to/foo.tgz'# To create a .bz2 archive:tar -cjvf'/path/to/foo.tgz''/path/to/foo/'
To see what cheatsheets are available, runcheat -l
.
Note that, whilecheat
was designed primarily for *nix system administrators,it is agnostic as to what content it stores. If you would like to usecheat
to store notes on your favorite cookie recipes, feel free.
It is recommended to installcheat
withpip
:
[sudo] pip install cheat
Other installation methods are available.
The value ofcheat
is that it allows you to create your own cheatsheets - thedefaults are meant to serve only as a starting point, and can and should bemodified.
Cheatsheets are stored in the~/.cheat/
directory, and are named on aper-keyphrase basis. In other words, the content for thetar
cheatsheet livesin the~/.cheat/tar
file.
Provided that you have aCHEAT_EDITOR
,VISUAL
, orEDITOR
environmentvariable set, you may edit cheatsheets with:
cheat -e foo
If thefoo
cheatsheet already exists, it will be opened for editing.Otherwise, it will be created automatically.
After you've customized your cheatsheets, I urge you to track~/.cheat/
alongwith yourdotfiles.
Personal cheatsheets are saved in the~/.cheat
directory by default, but youcan specify a different default by exporting aDEFAULT_CHEAT_DIR
environmentvariable:
export DEFAULT_CHEAT_DIR='/path/to/my/cheats'
You can additionally instructcheat
to look for cheatsheets in otherdirectories by exporting aCHEATPATH
environment variable:
export CHEATPATH='/path/to/my/cheats'
You may, of course, append multiple directories to yourCHEATPATH
:
export CHEATPATH="$CHEATPATH:/path/to/more/cheats"
You may view which directories are on yourCHEATPATH
withcheat -d
.
cheat
can optionally apply syntax highlighting to your cheatsheets. To enablesyntax highlighting, export aCHEATCOLORS
environment variable:
export CHEATCOLORS=true
You may manually specify which syntax highlighter to use for each cheatsheet bywrapping the sheet's contents in aGithub-Flavored Markdown code-fence.
Example:
```sql-- to select a user by IDSELECT *FROM UsersWHERE id = 100```
If no syntax highlighter is specified, thebash
highlighter will be used bydefault.
About
cheat allows you to create and view interactive cheatsheets 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.
Resources
License
Stars
Watchers
Forks
Packages0
Languages
- Python89.8%
- Shell10.2%