Mastering Linux with This Essential Command!

Mastering Linux with This Essential Command!

Source: Liangxu Linux (ID: liangxulinux)
If you want to reprint, please contact the original public account
Today, I will introduce you to a super useful Linux command. With this command, you can easily use almost all common commands on Linux without worrying about remembering so many options!
We know that there are about 300 to 500 commands in the Linux system, and some distributions have even more. Each command has numerous options, making it nearly impossible to remember every command’s usage.
So, what do we usually do when we encounter a command we don’t know how to use? That’s right, we use <span>man</span>.
Similar to <span>man</span>, there are also commands like <span>help</span> and <span>info</span>. However, these commands have one thing in common: they provide information that is extremely long and looks like a foreign language. This is particularly troublesome for those who are not proficient in English.
Although you have seen it many times, let me take another screenshot to hurt you one more time:
Mastering Linux with This Essential Command!
Likewise, <span>whereis</span> and <span>whatis</span> may not be long, but the information they provide is basically useless.
Now, let me introduce the star of this article— <span>cheat</span>!
What is this command used for?
Literally speaking, its role is “cheat sheet”. It won’t give you a lot of lengthy discussions but will get straight to the point and tell you how to use the command directly.
Let me give you a simple example to let you feel it.
For instance, if I want to know how to use the network tool <span>netstat</span> and what common parameters it has, I just need to input the following command:
$ cheat netstat

Mastering Linux with This Essential Command!
Look at this result, no nonsense, it goes straight to the examples, making everything clear!
Moreover, it kindly informs you that the <span>netstat</span> command is not commonly used anymore and suggests using the <span>ss</span> command instead.
In contrast, the <span>man</span> manual…
Mastering Linux with This Essential Command!
Oh my, this is quite painful to look at… Just the introduction of this option has already discouraged me…
This might be the reason why programmers are losing their hair…
Mastering Linux with This Essential Command!
OK, now that we know how powerful the <span>cheat</span> command is, let’s introduce how to install and use this command.
On Ubuntu systems, you can get it done with just one command:
$ sudo snap install cheat 

When you use it for the first time, it will ask if you want to download the configuration and manual files; just keep pressing Enter.
Mastering Linux with This Essential Command!
Then you can use it normally; the installation process is quite smooth and convenient.
Its basic usage is also very simple, as shown in the previous example:
$ cheat <your command="" search="" to="">

</your>
You can also check all the usages of this command by using <span>cheat -h</span>:
$ cheat -h
Usage:
  cheat [options] [<cheatsheet>]

Update community cheatsheets via:
  cheat.update

Options:
  -a --all                Search among all cheatpaths
  -c --colorize           Colorize output
  -d --directories        List cheatsheet directories
  -e --edit=<cheatsheet>  Edit <cheatsheet>
  -l --list               List cheatsheets
  -p --path=<name>        Return only sheets found on cheatpath <name>
  -r --regex              Treat search <phrase> as a regex
  -s --search=<phrase>    Search cheatsheets for <phrase>
  -t --tag=<tag>          Return only sheets matching <tag>
  -T --tags               List all tags in use
  -v --version            Print the version number
  --rm=<cheatsheet>       Remove (delete) <cheatsheet>

</cheatsheet></cheatsheet></tag></tag></phrase></phrase></phrase></name></name></cheatsheet></cheatsheet></cheatsheet>
In fact, it writes an introduction file for each command, and these files are stored by default in the <span>~/snap/cheat/</span> directory under your home directory.
Let’s count, there are 249 files in total here. If you want to add a command yourself, just create a corresponding command file in here.
If you want to modify the explanation of a certain command, you can use the following command:
$ cheat -e <command modify="" to=""/>

Then it will call the nano editor to modify the introduction of this command, but you can also change it to another editor by modifying the configuration file.
If you want to delete a command, you can either delete the corresponding file directly or use the following command:
$ cheat --rm=<command delete="" to=""/>

If you want to search for commands based on keywords, you can use the following command:
$ cheat -s <keyword>

</keyword>
For example, if I want to search for all command files that contain the keyword remove, I can do it like this:
Mastering Linux with This Essential Command!
At this point, the basic usage of the <span>cheat</span> command has been introduced.
You can see that this command is incredibly powerful. With it, you can not only forget about memorizing commands but also say goodbye to searching on Baidu. If you don’t understand any command, just use <span>cheat</span> to look it up.
I somewhat regret introducing this artifact to everyone, knowing that I have also recorded a course on Linux commands, and the originally dismal sales have only worsened.
Everyone should cherish it, but I still suggest that you follow my course to systematically learn Linux commands. At least you should know that this command exists so you can use <span>cheat</span> or search for its usage on Baidu, right?
Mastering Linux with This Essential Command!

<END>

Programmer Exclusive T-shirt

Direct Purchase Link 👇

Mastering Linux with This Essential Command!

Recommended Reading:

Finally! I found the reason why programmers love wearing hoodies

The mysterious past of Linux memory A 7K intern hired by the company didn’t even know how to find files in Linux!

How to use the vmstat command in Linux

Leave a Comment