Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
/cheatPublic
forked fromcheat/cheat

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

NotificationsYou must be signed in to change notification settings

fpob/cheat

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyPI

cheat

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 obligatory xkcd

Example

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 usecheatto store notes on your favorite cookie recipes, feel free.

Installing

It is recommended to installcheat withpip:

[sudo] pip install cheat

Other installation methods are available.

Modifying Cheatsheets

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.

Configuring

Setting a DEFAULT_CHEAT_DIR

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'

Setting a CHEATPATH

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.

Enabling Syntax Highlighting

cheat can optionally apply syntax highlighting to your cheatsheets. To enablesyntax highlighting, export aCHEATCOLORS environment variable:

export CHEATCOLORS=true

Specifying a Syntax Highlighter

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.

See Also:

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

Packages

No packages published

Languages

  • Python89.8%
  • Shell10.2%

[8]ページ先頭

©2009-2025 Movatter.jp