Cheat: a collection of practical Linux Command examples | Linux China, cheatlinux
Many of us often look at man pages to learn about command switches (options). It displays command syntax, instructions, details, and available options, but it does not have any practical examples. Therefore, it may be difficult to combine a complete command we need. -- Magesh Maruthamuthu
In this article, we navigate to how Cheat is 10% cookbook How to install Cheat16 % cookbook How to Use Cheat62 % compiled from | https://www.2daygeek.com/cheat-a-collection-of-practical-linux-command-examples/
Author | Magesh Maruthamuthu
Translator | geekpi
Many of us often look at the man page [1] to understand the command switch (option). It displays command syntax, instructions, details, and available options, however, it does not have any actual examples. Therefore, it may be difficult to combine a complete command we need.
Are you sure you want a better solution to this problem? I suggest you give it a try.cheat
.
What is Cheat?
Cheat [2] allows you to create and view the interactive quick query table cheatsheet in the command line. It is designed to help remind * nix system administrators of the options they often use but are not frequently remembered.
How to install Cheat
cheat
Is developed using python, so you can usepip
To install on your systemcheat
.
pip
Issetuptools
The bundled Python module is one of the recommended tools for installing the Python package in Linux.
For Debian/Ubuntu users, use the apt-get command [3] or apt Command [4] to installpip
.
[For Python2]
$ sudo apt install python-pip python-setuptools
[For Python3]
$ sudo apt install python3-pip
RHEL/CentOS official repository does not contain pip, so use EPEL repository [5] and run the YUM Command [6] to installpip
.
$ sudo yum install python-pip python-devel python-setuptools
For the Fedora system, run the dnf Command [7] to installpip
.
[For Python2]
$ sudo dnf install python-pip
[For Python3]
$ sudo dnf install python3
For Arch Linux-based systems, use the Pacman Command [8] to installpip
.
[For Python2]
$ sudo pacman -S python2-pip python-setuptools
[For Python3]
$ sudo pacman -S python-pip python3-setuptools
For openSUSE systems, run the Zypper Command [9] to installpip
.
[For Python2]
$ sudo pacman -S python-pip
[For Python3]
$ sudo pacman -S python3-pip
Usepip
To install on your systemcheat
.
$ sudo pip install cheat
How to Use Cheat
Runcheat
And then follow the correspondingCommand
To view the quick query table. For example, let's look at it.tar
Command example.
$ 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 extract a .tar in specified Directory:
tar -xvf /path/to/foo.tar -C /path/to/destination/
# 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 ...
Run the following command to view the available quick query tables.
$ cheat -l
Go to the Help page for more details.
$ cheat -h
Via: https://www.2daygeek.com/cheat-a-collection-of-practical-linux-command-examples/
Author: Magesh Maruthamuthu [11] Translator: geekpi Proofreader: wxy
This article was originally compiled by LCTT and launched with the honor of Linux in China
Geekpi, LCTT translator? ? Total Translation: 623 contributions: 1530 days
Recommended articles
<Slide left and right to view related articles>
Click an image, enter the Document ID, or identify the QR code.
For the original text link, visit "Original Text Link" to obtain the link that can be clicked, full-size source images, and related articles.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.