|
Linux command line powerful and flexible in its diversity, the various Linux commands with its own proprietary command-line options and parameters. Mix and match these commands, you can even link to different commands through pipes and redirection. In theory, you can use a few basic commands to generate hundreds of use cases. Even for administrators who are steeped for many years, it is difficult to fully use them. That is the moment we become the command line cheat sheet of straw.
I know the online manual pages (man) remains our mentor, but we want the quick reference card at their disposal that we can make it all more efficient and purposeful. Ultimate cheat sheet may be hanging proudly in your office, it may be stored as PDF files hidden on your hard drive, or even set to your desktop background image.
As an alternative, you can also access your favorite command line cheat sheet by another command. That is, the use of cheat. This is a command-line tool, which lets you read from the command line, create or update the cheat sheet. The idea is simple, but cheat proved to be very useful. This tutorial focuses on use of Linux cheat command. You do not need to be a cheat sheet to cheat the command, it's really simple.
Cheat to install Linux
First, if you have not Git, then install a bar:
$ Sudo apt-get install git (Debian-based system)
$ Sudo yum install git (RedHat-based system)
At the same time, the installation package Python installer pip.
Finally, use the following command to install cheat.
$ Sudo pip install docopt pygments
$ Git clone https://github.com/chrisallenlane/cheat.git
$ Cd cheat
$ Sudo python setup.py install
Configuration Cheat
cheat command does not require much configuration.
A recommended configuration is to enable command-line completion. So, when a cheat sheet when you query, you can use the [TAB] key to automatically complete the command name you want to see the. The following actions can enable auto-completion bash under.
$ Wget https://github.com/chrisallenlane/cheat/raw/master/cheat/autocompletion/cheat.bash
$ Sudo cp cheat.bash /etc/bash_completion.d/
They also provide auto-completion for other shell scripts, such as zsh and fish there.
Another thing to do is to define the environment variable EDITOR. When this variable should point to create or update the cheat sheet you want to use text editor. For example, if you want to use Vim editor, then the following contents into ~ / .bashrc.
export EDITOR = / usr / bin / vim
Log off and log back in, in order to activate the auto-complete feature and update .bashrc.
Cheat basic usage
cheat command a cool thing is that it comes with over 90 commonly used Linux commands built-in cheat sheet. View a list of available cheat sheet:
$ Cheat -l
To access a specified command cheat sheet cheat just run the command, followed by the name of the command:
$ Cheat < command-name>
You can use the "-s" option in all cheat sheet contains the specified keyword search content:
$ Cheat -s < keyword>
In many cases, cheat sheet suitable for some people, while others did not help. Built-in cheat sheet to get more personalized, cheat command also allows you to create new cheat sheet, or update existing ones. To do so, cheat command will help you to save a copy of the cheat sheet in the local ~ / .cheat directory.
To use the cheat editing functions, first make sure that your EDITOR environment variable is set to default the full path to the location where the editor. Then, copy (not editable) built-in cheat sheets to ~ / .cheat directory. You can find the location of the built-in cheat sheet by the following command. Once you find their location, just copy them to ~ / .cheat directory.
$ Cheat -d
/usr/lib/python2.6/site-packages/cheat/cheatsheets
$ Cp /usr/lib/python2.6/site-packages/cheat/cheatsheets/* ~ / .cheat
Now, you can use the "-e" option to create or update a cheat sheet on:
$ Cheat -e openssl
As you can imagine, cheat editing function is very useful and can help you tailor local library cheat sheet to meet your needs. If you are convinced that knowledge-sharing, contribute your cheat sheet to cheat the official Git repository command, you will be more popular, so that everyone can benefit from it. |
|
|
|