linux命令小工具-cheat

linux系统命令帮助有man,help等经常使用的工具,可是对于大多数初学者可能看不懂,cheat能够很好地帮助咱们使用一个命令。python

cheat命令是干吗的呢?linux

cheat命令简单来讲,就是告诉你一个命令如何使用。它没有提供其余额外多余的信息,只经过使用实例告诉你一个命令如何使用。
git

好比说,你想要知道解压命令tar如何使用,都有哪些选项参数等。只须要简简单单的输入
github

[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并无这个安装包bash

一、安装python和pip
ide

yum install -y python python-pip
工具

pip install docopt pygmentsspa

二、下载并安装cheatip

yum install -y gitget

 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 

相关文章
相关标签/搜索