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
cd cheat/
ls
bin CHANGELOG cheat CONTRIBUTING.md LICENSE licenses README.md setup.py
python setup.py install