Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to remember Linux commands easily

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

How to easily remember Linux commands, for this question, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and easy way.

Novices to Linux tend to be afraid of the command line. Part of the reason is that you need to remember a large number of commands, after all, mastering commands is a prerequisite for efficient use of the command line.

Unfortunately, there are no shortcuts to learning these commands, but there are some tools that can help you when you start learning commands.

History

Linux Bash History command

The first thing to introduce is the command line tool history, which can help you remember the commands you have used. Most Linux shell, including the most widely used Bash, create a history file that contains the commands you have typed. If you are using Bash, the history file is / home//.bash_history.

This history file is in plain text format, and you can open it with any text editor to browse and search.

Apropos

There is a command that can help you find other commands. This command is apropos, which can help you find the right 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"

Linux Apropos

This is the search result, very direct. Add the plural to "directory" and try again.

Apropos "list directories"

It won't work this time. What apropos does is actually search for descriptions of a series of commands. Commands that describe mismatches are not included in the results.

There are other uses. With the-a flag, you can add search keywords in a more flexible way. Try this command:

Apropos "match pattern"

Linux Apropos-a Flag

You would think that there should be some matching content, such as grep, right? However, there is actually no match. Again, apropos searches only literally.

Now let's try to separate the words with the-a sign. (LCTT translation note: this option means "and", that is, multiple keywords exist, but strings that happen to be concatenated are not required. )

Apropos "match"-a "pattern"

At this point, you can see a lot of expected results.

Apropos is a great tool, but you need to be aware of its flaws.

ZSH

Linux ZSH Autocomplete

ZSH is not really a tool for memorizing commands. It's actually a shell. You can use ZSH instead of Bash as your command line shell. ZSH includes an automatic error correction mechanism that can give you a prompt when you enter a command. When this function is turned on, it will prompt you for similar choices. In ZSH you can use the command line as usual, while you can enjoy an extremely secure network and other very useful features. The easiest way to take full advantage of ZSH is to use Oh-My-ZSH.

Shorthand chart

* *, and perhaps the most indirect way is to use shorthand.

There are many online shorthand notes, such as this one, which can help you query commands quickly.

Linux-commandline-cheatsheet

For a quick query, you can look for a shorthand sheet in image format and set it as your desktop wallpaper.

This is not a way to memorize commands, but it can save you time searching for forgotten commands online.

Rely on these methods when learning, and eventually you will find that you will use these tools less and less. No one can remember everything, so it's normal to forget something occasionally or encounter something you haven't seen before. This is the meaning of these tools and the existence of the Internet.

This is the answer to the question on how to easily remember Linux commands. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report