cheat工具是一款非常適合Linux系統管理員的一款工具,他能幫助你很簡單快捷的熟悉Linux下系統命令的使用方法,如下圖:
cheat的安裝很簡單:
cheat有兩個依賴工具 python和 pip,所以在安裝cheat之前,需要安裝python和pip。
# yum install python
# yum install python-pip
通過git下載cheat:
# apt-get install git
然後安裝python的依賴:
# pip install docopt pygments
從git庫中克隆cheat:
# git clone https://github.com/chrisallenlane/cheat.git
進入cheat目錄,運行setup.py
# cd cheat
# python setup.py install
安裝完成OK,可以查看cheat版本
# cheat -v
cheat 2.1.0
cheat的一些其他配置:
需要在~/.bashrc配置一個默認的文本編輯器
# export EDITOR = /usr/bin/vi
這個文本編輯器可以根據自己的喜好設定,可以設定其他的,比如nano
如果你需要cheat的自動補齊功能,可以這樣去git上復制cheat.bash這個腳本:
# wget https://github.com/chrisallenlane/cheat/raw/master/cheat/autocompletion/cheat.bash^C
# mv cheat.bash /etc/bash_completion.d/
cheat還可以根據自己的需要自定義命令的幫助文件,自定義目錄默認在~/.cheat/目錄下,我們先來看下cheat自帶的命令幫助文件的目錄:
# cheat -d
/root/.cheat
/usr/lib/python2.7/site-packages/cheat/cheatsheets
# cp /usr/lib/python2.7/site-packages/cheat/cheatsheets/* /root/.cheat/
我們可以將/usr/lib/python2.7/site-packages/cheat/cheatsheets下的所有文件都拷貝到/root/.cheat下,你也可以根據自己的需要建立自己的其他命令幫助備忘錄文件。
這樣cheat工具就安裝完成了,對於以後遇到命令不記得怎麼使用便可以好好利用它了。
Linux命令之cd http://www.linuxidc.com/Linux/2013-05/83948.htm
Linux命令之cat http://www.linuxidc.com/Linux/2013-05/83947.htm
Linux命令之alias/unalias http://www.linuxidc.com/Linux/2013-05/83946.htm
Linux命令解析:su root和su -root http://www.linuxidc.com/Linux/2013-04/82564.htm
Linux命令之 交互式輸入read http://www.linuxidc.com/Linux/2013-03/81594.htm