In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Editor to share with you what is the use of the Man command in Linux, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!
There are many commands on Linux, different command options achieve different functions, in the daily use process, it is impossible to remember all the command options, frequently used commands, after a period of time will also forget, or encounter a strange command, how to know what common parameters it has and the description of each parameter?
The omnipotent help command man in Linux can perfectly solve the above problems. Man can query the help documentation of the command in real time, from which you can learn all the parameters and instructions about the command. With it, you no longer have to worry about not remembering the options and usage of the command.
Installation of man help manual
Man is an acronym for manual, which is installed by default in Linux, but sometimes No manual entry for xxx in section xx errors occur because the manual is incomplete and can be solved by reinstalling it with the following command.
Yum install man-pages
Ways to get help
You can get help for a specified command by using the man command name command. Here is an example of getting help from the command pwd
After executing the man pwd command in the figure above, the syntax of the pwd command and the usage description of each option are output. Press Q key to exit the help.
Here are the keyboard shortcuts and introductions commonly used in the man help page, which are often used when viewing help
↑: move one line up ↓: move one space down or f: turn down a page b: turn a page up /: search from top to bottom, n next matching position, N on a matching position, usage: / search from bottom to top, n next matching position, N next matching position, N next matching position, usage: & / search content enter
Common parts of the help page
Each man help page contains NAME, SYNOPSIS, DESCRIPTION, and OPTIONS sections. The meaning of each section is listed below.
NAME: command name and brief introduction SYNOPSIS: syntax format of the command DESCRIPTION: detailed description of the command OPTIONS: command options and their descriptions
The chapter of help explains
The man command itself is also a command, and you can get help from man through man man
In the figure above, the numbers in the MAN (1) string in the red box represent the chapters, and the first chapter is shown here.
The green box in the picture is the description of each chapter of the man help. You can see that there are a total of nine chapters.
What do these nine chapters mean? when getting help from Linux, there are a lot of commands involved, so they are classified into nine chapters. The specific chapter information is as follows:
1: terminal shell command, that is, ordinary command 2: system call, such as open, write function, you can easily find the function information, such as: header file, function function description, function parameter, function return value and the meaning of the return value 3: library calls, such as fread, fwrite function 4:/dev directory device file 5: configuration file format and description For example: / etc/passwd file format description 6: game 7: macro convention 8: system management commands, generally only allow root to use, such as: ifconfig command 9: kernel routines, currently not used
Through the man chapter number command name, you can get the help of the specified chapter of the command, for example: the classification of the first chapter is the terminal shell command, if we want to get the help of the first chapter of the ls command, we can execute the man 1 ls command, when we use the first chapter, we can omit the number 1 in the man 1 ls, and finally the command becomes man ls.
You may wonder why man should be divided into nine chapters to help.
Because commands, system calls, files, and so on may have duplicate names in the help of different chapters, if there is a duplicate name, it is impossible to distinguish which chapter's help is only using the man command name.
For example: passwd is the command to set the user's password, / etc/passwd is the password configuration file, and both names are passwd. When using man passwd to get help, it is difficult to distinguish between the help of the passwd command and the help of the / etc/passwd configuration file.
As you can see from the above example, you get the help of the passwd command through man 1 passwd and the help of / etc/passwd configuration file through man 5 passwd
View the help pages that match the command one by one
Sometimes we don't know whether a command is a terminal command, a system call, or a configuration file, so we can use the man-a command name to view the help information one by one from the list of chapters that match the command name.
In the above example, the man-a passwd command looks at passwd help chapter by chapter from a list of chapters that match the name of the command
The first thing to look at is the help in the first chapter, where passwd represents the shell command to change the user's password
Next up is the help in the first chapter, where passwd represents the command in the OpenSSL module to calculate the password hash
The last thing to look at is the help in chapter 5, where passwd represents the / etc/passwd configuration file
In the process of viewing, if you do not want to view this help, you can press Ctrl + D to skip the current help, go to the next help location, press ```q to exit the current view, and then press enter to enter the next help location, and press Ctrl + C ```to exit the help directly.
Other help commands
Linux help commands in addition to man, there are help and info, help is just a simple list of command options and their brief introduction, more concise than man, info has a very detailed description of the command, more detailed than man, can be used as a supplement to man.
The above is all the content of the article "what is the use of Man commands in Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.