Cheat: a collection of practical Linux Command examples | Linux China, cheatlinux

Source: Internet
Author: User
Tags arch linux

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

cheatIs developed using python, so you can usepipTo install on your systemcheat.

pipIssetuptoolsThe 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.

 
  1. [For Python2]

  2. $ sudo apt install python-pip python-setuptools

  3. [For Python3]

  4. $ 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.

 
  1. $ sudo yum install python-pip python-devel python-setuptools

For the Fedora system, run the dnf Command [7] to installpip.

 
  1. [For Python2]

  2. $ sudo dnf install python-pip

  3. [For Python3]

  4. $ sudo dnf install python3

For Arch Linux-based systems, use the Pacman Command [8] to installpip.

 
  1. [For Python2]

  2. $ sudo pacman -S python2-pip python-setuptools

  3. [For Python3]

  4. $ sudo pacman -S python-pip python3-setuptools

For openSUSE systems, run the Zypper Command [9] to installpip.

 
  1. [For Python2]

  2. $ sudo pacman -S python-pip

  3. [For Python3]

  4. $ sudo pacman -S python3-pip

UsepipTo install on your systemcheat.

 
  1. $ sudo pip install cheat

How to Use Cheat

RuncheatAnd then follow the correspondingCommandTo view the quick query table. For example, let's look at it.tarCommand example.

 
  1. $ cheat tar

  2. # To extract an uncompressed archive:

  3. tar -xvf /path/to/foo.tar

  4. # To create an uncompressed archive:

  5. tar -cvf /path/to/foo.tar /path/to/foo/

  6. # To extract a .gz archive:

  7. tar -xzvf /path/to/foo.tgz

  8. # To create a .gz archive:

  9. tar -czvf /path/to/foo.tgz /path/to/foo/

  10. # To list the content of an .gz archive:

  11. tar -ztvf /path/to/foo.tgz

  12. # To extract a .bz2 archive:

  13. tar -xjvf /path/to/foo.tgz

  14. # To create a .bz2 archive:

  15. tar -cjvf /path/to/foo.tgz /path/to/foo/

  16. # To extract a .tar in specified Directory:

  17. tar -xvf /path/to/foo.tar -C /path/to/destination/

  18. # To list the content of an .bz2 archive:

  19. tar -jtvf /path/to/foo.tgz

  20. # To create a .gz archive and exclude all jpg,gif,... from the tgz

  21. tar czvf /path/to/foo.tgz --exclude=\*.{jpg,gif,png,wmv,flv,tar.gz,zip} /path/to/foo/

  22. # To use parallel (multi-threaded) implementation of compression algorithms:

  23. tar -z ... -> tar -Ipigz ...

  24. tar -j ... -> tar -Ipbzip2 ...

  25. tar -J ... -> tar -Ipixz ...

Run the following command to view the available quick query tables.

 
  1. $ cheat -l

Go to the Help page for more details.

 
  1. $ 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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.