If you want to program one side in Linux, you must master the skills, that is, view help.
Maybe you are used to Google or Baidu for help, but use the following method to get information faster and learn more systematically.
There are two methods to view the help of a command:
- Command + -- Help
- MAN + command
These two methods generally have one form of commands, some of which both have the same output and will tell you how to use the commands and the options supported by the commands, for example:
g++ --helpman g++
The first sentence in the Command g ++ -- help output is: Usage: G ++ [Options] file... this is the usage of this command. g ++ is connected to options and then to the file. The brackets mean that the options are optional. You can leave them blank, you can also give any number of options. What are the specific options of G ++? The previous blog introduced a few items, and the rest of them opened the window of the black hole and entered the command. There are too many posts.
The man G ++ output has its own format, but it is similar. Try it on your own. The following describes the differences between the two commands.
Command + -- Help
This help is provided by the command and written in the code when the author writes the command. -- help is an option to call the command. If the author of the implementation command does not provide this option, you cannot view the help in this way. However, most commands are supported.
MAN + command
This man is the abbreviation of manual (manual). It is itself a command. You can also regard it as a man. If you have any command that you don't understand, ask this kind of friend. You can also use man -- help or man to view help information about this friend.
Man explained to himself that an interface to the on-line reference manuals is an interface used to view online manuals, in fact, many Command help files are saved locally. But it doesn't matter. The important thing is that the Help file is separated from the command. The author of the Help file and command can not be a person. Therefore, in theory, you can write a ls help file, but the content is indeed the help of G ++...
Since man is an interface, it means that the format of the Help file is required. Therefore, all man-displayed help files will have descriptions such as name, synopsis, description, and so on. If you want to write a man page, you also need to comply with its requirements.
Generally, commands can be used to help you understand either of them. Some commands are only helpful and can be easily read.
Finally, let's take a look at some of the commands mentioned earlier or the help of the commands we know. Practice makes perfect :)