linux中使用cheat工具掌握系統命令使用方法

來源:互聯網
上載者:User

標籤:命令   linux   python   cheat   

      cheat工具是一款非常適合linux系統管理員的一款工具,他能協助你很簡單快捷的熟悉linux下系統命令的使用方法,如:
650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/49/15/wKiom1QOoxeAQFT3AADpogzA6KI190.jpg" title="QQ圖片20140909144555.png" alt="wKiom1QOoxeAQFT3AADpogzA6KI190.jpg" />

  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 -vcheat 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中使用cheat工具掌握系統命令使用方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.