The use of Man Handbook in Linux--taking CentOS6.8 as an example
This article is intended to show you how to quickly start a new command in Linux, after all, in a Linux system, you can do everything by command.
Related commands: Help mans Whatis Info
#whatis
A friend with a certain understanding of English, should be very familiar with the word is two words, like "what", so for a less familiar command, you can first use this command to view, such as input "Whatis echo", will show
echo (1) - display a line of textecho (1p) - write arguments to standard outputecho [builtins] (1) - bash built-in commands, see bash(1)
Now let's introduce the meaning of the above three lines of information. Each line is divided into three parts,
第一部分是命令名称;第二部分是命令在man手册出现的位置,第三部分是简述命令或函数的作用
Now with the first example, the first line means: The echo command is described in the first part of the Man manual, and its function is to display a line of textual information. If you want to learn more about the echo command, you can use the command:
1 echo 或 man echo
Of course you can omit 1, that is, use the man echo command to view, but if it is a different number, you cannot omit it. The Man handbook is divided into several sections, followed by the composition of the Man Handbook.
Linux Command classification
Before introducing the man manual, it is necessary to understand that the commands in the Linux system can be divided into internal commands and external commands. Internal commands, also known as built-in commands (BUILTIN). How do you differentiate between internal commands and external commands? Enter the man Bash command to view all internal commands.
man bash// NAME字段后面的命令都是内部命令
How to view commands using method internal commands
Way One
#help command, use Help directly, followed by commands to query, for example:
help cd
The results of the query are as follows
the shell working directory.Change the current directory to DIR. The default DIR is the value of theHOME shell variable....
Way Two
#man Help, execute this command and get a list of all built-in commands and how to use it
man help
The query results are as follows:
Bash_builtins (1) Bash_builtins (1) NAME bash,:,., [,AliasBgBindBreakBuiltinCallerCdcommand, Compgen, complete, compopt,ContinueDeclareDirsDisown,EchoEnableEvalExecExitExportFalseFcFgGetopts,HashHelpHistoryJobsKillLetLocalLogoutMapfilepopdPrintfpushd, pwd, read, readonly, return, set, shift, shopt, source, suspend, test, times, trap, true, type, typeset, ulimit, umask, unalias, unset, wait-bash built-in commands , see Bash (1) bash BUILTIN COMMANDS ...
Commands between the "NAME" field and "BASH BUILTIN COMMANDS" belong to the built-in command
External command
Way One
Use command--help, for example:
--help
Query Result:
GNU bash, version 4.1.2(1)-release-(x86_64-redhat-linux-gnu)Usage:bash [GNU long option] [option] ... bash [GNU long option] [option] script-file ...GNU long options: --debug --debugger...
For some commands, you can also shorthand for command-h.
Way Two
User manual (manual), format: Man COMMAND, for example
man bash
Query Result:
GNU bash, version 4.1.2(1)-release-(x86_64-redhat-linux-gnu)Usage:bash [GNU long option] [option] ... bash [GNU long option] [option] script-file ...GNU long options:--debug--debugger...
Mode three
Use the Info page info COMMAND, for example:
info bash
Query Result:
File: bash.info, Node: Top, Next: Introduction, Prev: (dir), Up: (dir)Bash Features*************This text is a brief description of the features that are present inthe Bash shell (version 4.1, 23 December 2009). This is Edition 4.1, last updated 23 December 2009, of `The GNU BashReference Manual‘, for `Bash‘, Version 4.1....
As for how to use the info manual, we will introduce it later.
Man Handbook
"Man" is the abbreviation of the English word manual, the Chinese meaning is the manual, the Help document, in the CentOS 6.8 system, calls the Man Man command, displays the word "Formatting online Help document".
Man Manual Chapter
The Standard Man Handbook is divided into 8 chapters, namely:
1 user Commands//Users command
2 system Calls//Systems Call
3 C library Functions//C function libraries call
4 Devices and special files//device file and special files
5 file Formats and Conventions//profiles and formats
6 games et. Al.//Games
7 Miscellanea//Miscellaneous
8 System Administration Tools and Deamons//management class commands
Note: The man manual described here refers to the standard man manual, and different versions of Linux distributions may add something to their manual.
Field description in Man Handbook
帮助手册中的段落说明:NAME 名称及简要说明SYNOPSIS 用法格式说明? [] 可选内容? <> 必选内容? a|b 二选一? { } 分组? ... 同一内容可出现多次DESCRIPTION 详细说明OPTIONS 选项说明EXAMPLES 示例FILES 相关文件AUTHOR 作者COPYRIGHT 版本信息REPORTING BUGS bug信息SEE ALSO 其它帮助参考
Use formatting
man [章节] COMMAND
Man manual view mode
The view here is that after the specific command, the page about the command may have more than one line or more pages, how to switch views on these pages, as well as some other quick actions.
q Q ZZ 退出g 1g 光标跳至文档首部G 光标跳至文档尾部e j 文档前进N行y k 文档后退N行f space 文档前进N页b ^B 文档后退N页/patternn/N 向后查询、?pattern 向前查询&pattern 只显示匹配到的行
Alternatively, you can use the Info manual to view
free
After entering the info page, press "H" to bring up the help document
The use of the Man handbook in Linux