好用的cheat命令

回复 收藏
本帖最后由 xuliang 于 2016-7-26 09:38 编辑

linux系统命令帮助有man,help等常用的工具,但是对于大多数初学者可能看不懂,cheat可以很好地帮助我们使用一个命令。
cheat命令是干嘛的呢?
cheat命令简单来说,就是告诉你一个命令如何使用。它没有提供其他额外多余的信息,只通过使用实例告诉你一个命令如何使用。
比如说,你想要知道解压命令tar如何使用,都有哪些选项参数等。只需要简简单单的输入
[root@localhost2 cheat]# cheat tar
# To extract an uncompressed archive:
tar -xvf /path/to/foo.tar

# To create an uncompressed archive:
tar -cvf /path/to/foo.tar /path/to/foo/

# 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 list the content of an .gz archive:
tar -ztvf /path/to/foo.tgz

# 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 list the content of an .bz2 archive:
tar -jtvf /path/to/foo.tgz

# To create a .gz archive and exclude all jpg,gif,... from the tgz
tar czvf /path/to/foo.tgz --exclude=\*.{jpg,gif,png,wmv,flv,tar.gz,zip} /path/to/foo/

# To use parallel (multi-threaded) implementation of compression algorithms:
tar -z ... -> tar -Ipigz ...
tar -j ... -> tar -Ipbzip2 ...
tar -J ... -> tar -Ipixz ...
怎么安装cheat呢;默认linux并没有这个安装包
1、安装python和pip
yum install -y python python-pip
pip install docopt pygments
2、下载并安装cheat
yum install -y git
git clone https://github.com/chrisallenlane/cheat.git
cd cheat/
ls
bin  CHANGELOG  cheat  CONTRIBUTING.md  LICENSE  licenses  README.md  setup.py
python setup.py install 3、查看版本
cheat
Usage:
  cheat
  cheat -e
  cheat -s
  cheat -l
  cheat -d
  cheat -v


cheat -v 查看版本
cheat -l 查看支持的命令
cheat -l|wc -l
147


2016-07-26 09:32 举报
已邀请:

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: