The man Command

The man command is used to format and display the man pages.

The man pages are a user manual that is by default built into most Linux distributions (i.e., versions) and most other Unix-like operating systems during installation. They provide extensive documentation about commands and other aspects of the system, including configuration filessystem callslibrary routines and the kernel (i.e., the core of the operating system). A configuration file is a type of simple database that contains data that tells a program or operating system how to behave. A system call is a request made via a software interrupt (i.e., a signal to the kernel initiated by software) by an active process for a service performed by the kernel. A library routine is a subprogram that is used by programmers to simplify the development of software.

The man pages are tailored to the particular operating system, and version thereof, on which they are installed. This is beneficial because there can be slight differences in commands and other items according to the particular system.

The descriptions are rather terse, and they can seem somewhat cryptic to new users. However, users typically find them to be increasingly useful as they become more familiar with them and gain experience in the use of Unix-like operating systems.

The man command itself is extremely easy to use. Its basic syntax is

man [option(s)] keyword(s)

man is most commonly used without any options and with only one keyword. The keyword is the exact name of the command or other item for which information is desired. For example, the following provides information about the ls command (which is used to list the contents of any specified directory):

man ls

As another example, the following displays the man page about the man pages:

man man

man automatically sends its output through a pager, usually the program less. A pager is a program that causes the output of any program to be displayed one screenful at a time, rather than having a large amount of text scroll down the screen at high (and generally unreadable) speed.

less writes a colon at the bottom of the screen to indicate the end of the on-screen page. The user can move to the next page by pushing the space bar and can return to the previous page by pressing the b key. Pressing the q exits the man pages and returns the user to the shell program.

Each man page is a self-contained article that is divided into a number of sections, the headers for which are labeled with upper case letters. The sections for commands are typically something like NAME, SYNOPSIS, DESCRIPTION, OPTIONS, AUTHOR, BUGS, COPYRIGHT, HISTORY and SEE ALSO, although there may be some differences according to the particular command. Some of these might be broken down into subsections, particularly OPTIONS in the case of a command that has numerous options.

Also, the man pages as a whole are organized into sections, each containing pages about a specific category of topics as shown below. The section to which an article belongs is indicted in parenthesis in the top line, before the NAME header.

1. executable programs or shell commands 
2. system calls 
3. library routines 
4. special files (i.e., devices in the /dev directory) 
5. file formats 
6. games 
7. macro packages 
8. system administration commands 
9. kernel routines 
n. Tcl/Tk (a programming language)

Some topic names will have multiple articles, depending on context. For instance, there are two articles for mount, one corresponding to its use as a command in system management (i.e., to logically attach partition or other devices to the main filesystem) and the other for use in the C programming language. Generally, the most commonly used topic is displayed by default, and there are references to any other topics with the same name in the SEE ALSO section at the bottom of the final on-screen page.

The syntax to specify an article from a particular section is:

man section_number keyword

Thus, for example, the following would display the article about mount from Section 2 instead of from the default Section 8:

man 2 mount

The -w and -W options tell man to not actually display the man pages, but to provide the location(s) of the file(s) that would be formatted or displayed. If no arguments (i.e., input files) are provided, a list of directories that is searched by man for man pages is returned.

The -f option produces the same output as the whatis command. whatis provides very brief descriptions of commands from a database that is automatically created from the first line of the NAME section of each relevant man page. The -h option displays a terse summary of man‘s syntax and options.

A simpler version of a man page, i.e., without backspaces and underscores, can be obtained by piping (i.e., transferring) its output to the col command used with its -b option. Thus, for example, the following would write such a version of the man page about the pstree command (which shows the processes currently on the system in a tree diagram) to a text file called pstree.txt (and create a file with this name if it did not already exist):

man pstree | col -b > pstree.txt

Unix-like operating systems often also have an additional built-in manual referred to as the Info documents, the content of which is largely identical to that of the man pages. These documents can be accessed with the info command.

Although the man pages are usually viewed in a console (i.e., all-text mode) or terminal window (i.e., a text-mode window in a GUI), they can also be viewed in the Konquerer web browser, which is included with many Linux distributions. Some users might find that this provides enhanced usability, including the ability to scroll up and down an entire article regardless of its length and greater ease of changing font sizes. Any man article can be displayed in Konquerer by typing man followed by a colon and the name of the program.

Thus, for example, the following would tell Konquerer to display the man page for pstree:

man:pstree

The Linux Information Project (LINFO) is providing an on-line alternative to the man pages with its series of articles about commonly used commands and other aspects of Linux. One major difference is that the LINFO articles are designed to be useful to users of all levels, including absolute beginners. In particular, emphasis is placed on the most useful options for commands and specific examples are often provided. An index, along with brief descriptions, of such articles about commands that have been provided to date is Index of Linux Commands.

原文地址:https://www.cnblogs.com/tl2f/p/8203116.html

时间: 2024-10-12 02:23:19

The man Command的相关文章

MISP版本嵌入式QT编译时出现mips-linux-gcc command not found

configure的时候都没什么问题我的configure是:./configure -prefix /opt/qt-jz -xplatform qws/linux-mips-g++ -embedded mips  configure顺利的过了,但是当make的时候,出现了mips-linux-gcc :Commond not fount! 我装的是mipsl-linux-gcc ,而且已经交叉编译过了个hello world了.. make时出现的错误是:make[1]: Entering d

quagga源码分析--通用库command

quagga是一个完整又成熟的系统,作为一个路由器软件,自然要提供人机接口. quagga提供snmp管理接口,而且,自然就会有对应的命令行管理格式,当然一般路由软件不会提供界面形式的,也许有webui,然而quagga并没有. 我们要看的就是这个命令行处理的代码 command. 接触过类似命令行的朋友肯定有一点点好奇吧,那么数量庞大的命令和参数输入,还可以提供提示和自动补齐,这肯定不是一件很简单的事情. 下面是一个配置示例: 1 ! 2 interface bge0 3 ip ospf au

加载语音license command

FUYI#copytftp flash0: Addressor name of remote host []? 1.1.1.1 Sourcefilename []? FGL162212WS_201606290212473480.lic Destinationfilename [FGL162212WS_201606290212473480.lic]? Accessingtftp://1.1.1.1/FGL162212WS_201606290212473480.lic... LoadingFGL16

Linux bash: scp: command not found的问题记录

1,scp报错 [[email protected] soft]# scpjdk-7u55-linux-x64.tar.gz 192.168.121.246:/soft/ [email protected]'s password: bash: scp: command not found lost connection [[email protected] soft]# 2,调试-v [[email protected] soft]# scp -vjdk-7u55-linux-x64.tar.g

mv command:unable to remove target: Is a director

mv command:unable to remove target: Is a director This is somewhat simple as long as we understand the concept. mv or move does not actually move the file/folder to another location within the same device, it merely replaces the pointer in the first

CentOS 中无法使用make,make install 命令 make: command not

CentOS 中无法使用make,make install 命令 make: command not found 1.安装make yum -y install gcc automake autoconf libtool make 2.安装gcc yum install gcc gcc-c++

Understanding the Top command on Linux

Article by AlexioBash published on his website about ArchLinux in italian. Know what is happening in "real time" on your systems is in my opinion the basis to use and optimize your OS. On ArchLinux or better on GNU/Linux in general thetopcommand

bash:yum:command not found 解决办法

最近在学rhel7,不知道怎么回事,今天突然yum不能用了, 提示: bash:yum:command not found 在度娘搜了半天,真不好说啥了. 自己研究了半天 步骤如下 第一步: http://mirrors.163.com/centos/7/os/x86_64/Packages/ 到上面这个网站去下载如下RPM包 python-iniparse-0.4-9.el7.noarch.rpm yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-

解决 linux -bash: telnet: command not found

输入命令telnet提示  linux -bash: telnet: command not found 解决方法: yum list telnet*   查看telnet相关的安装包 yum install telnet-server 安装telnet服务 yum install telnet.* 安装telnet客户端 然后运行telnet正常了

mysql SELECT command denied to user 'root'@'localhost' for table 'XXX' 报错1142

还是数据库权限的问题,不知道为啥赋给了所有权限后还是有各种权限问题,看来有空得整理一下mysql所有相关权限的问题了... 下面才是解决这个select权限的方法: mysql SELECT command denied to user 'root'@'localhost' for table 'XXX' 报错1142