New Linux users are often afraid of command lines. This is partly because you need to remember a large number of commands. After all, mastering commands is the prerequisite for efficient use of command lines.
New Linux users are often afraid of command lines. This is partly because you need to remember a large number of commands. After all, mastering commands is the prerequisite for efficient use of command lines.
Unfortunately, there is no shortcut to learning these commands, but some tools can help you at the beginning of your learning.
History
The command line tool history helps you remember the commands you used before. Most Linux shells, including the most widely used Bash, will create a history file containing the commands you have entered. If Bash is used, the history file is/home/ /. Bash_history.
This historical file is in plain text format. You can use any text editor to browse and search for it.
Apropos
There is indeed a command that can help you find other commands. This command is apropos, which helps you find the appropriate command to complete your search. For example, if you need to know which command can list the contents of a directory, you can run the following command:
apropos "list directory"
The search result is very direct. Add the plural value to "directory" and try again.
apropos "list directories"
This is useless. What apropos does is to search for descriptions of a series of commands. Commands with mismatched descriptions are not included in the results.
There are other usage methods. With the sign, you can add search keywords in a more flexible way. Try this command:
apropos "match pattern"
Do you think there should be some Matching content, such as grep? However, it does not actually match any results. Again, apropos only searches based on the literal content.
Now let's try to use the sign to separate words. (LCTT annotation: This option indicates "and", that is, multiple keywords exist, but it does not need to be a string that is connected together .)
apropos "match" a "pattern"
You can see a lot of expected results.
Apropos is a great tool, but you need to pay attention to its defects.
ZSH
ZSH is not actually a tool for memorizing commands. It is actually a shell. You can use ZSH to replace Bash as your command line shell. ZSH includes an automatic error correction mechanism, which can prompt you when you enter a command. When this feature is enabled, it will prompt you for similar options. In ZSH, you can use command lines as usual, and enjoy extremely secure networks and other useful features. The simplest way to make full use of ZSH is to use OhMyZSH.
Stenographer
Finally, the most important way is to use a stenographer.
There are many online stenography tables. For example, this can help you quickly query commands.
For quick query, you can search for a stenographer in the image format and set it as your desktop wallpaper.
This is not the best way to remember commands, but it can help you save time for searching for forgotten commands online.
Depending on these methods when learning, you will eventually find that you will use these tools less and less. No one can remember all things, so it is normal to occasionally forget something or encounter something that has never been seen. This is also the significance of these tools and the existence of the Internet.