2.6 Usage of manual



In UNIX, a convenient online manual is included. Here, it introduces the usage. The input is as follows.

Format

man command-name


Options

-k word
Display the list of entry including "word"


Let's try the ls command manual as an example. Although the contents are the same, the display format varies depending on the environment to use.

Example

$ man ls ↵
LS(1)     User Commands     LS(1)
NAME
    ls - list directory contents
SYNOPSIS
    ls [OPTION]... [FILE]...
DESCRIPTION
          :
          : (Omitting)
          :
    -l use a long listing format
          :


From "ls - list directory contents" you can see that the ls command has a function to display the contents of the directory.

From "-l use a long listing format", the -l option shows that the display is long format. In addition, there are the following items.


AUTHOR
author of the program

REPORTING BUGS
It is a contact when you find bugs in the program.

COPYRIGHT
copyright of the program

SEE ALSO
Commands related to this program and other functions. You can check the contents listed here with the man command.


Practice : Display cp manual


Let's check cp command by manual.


$ man cp ↵


The pager function is used to display the man command. Therefore scrolling etc. are the same as the operation of more/less command.

2.6.1 Section

In the manual of ls, there is a description "LS (1)". This means that the manual of ls is in section 1. The section of the manual is exists for classifying manual's contents by each characteristics. The sections have their number, and means as shown in following table.

 1  User command
 2  System call of UNIX
 3  System library and function of UNIX
 4  Device and device driver
 5  File format
 6  Game and demonstration
 7  Others
 8  Command for system administration
 9  Information about kernel

There is a command named passwd. It is a command that sets the login password. Let's see the manual of it.


Practice : Display manual by section


$ man passwd ↵
              :
              :
SEE ALSO
     group(5), passwd(5), shadow(5).


passwd (5) appeared on the last SEE ALSO. This means that there is also an entry called passwd in section 5, so please refer to it. Quit the man command with q and refer to the manual of section 5. To see the entries for passwd in section 5, type:


$ man 5 passwd ↵
PASSWD(5)      File Formats and Conversions      PASSWD(5)
NAME
     passwd - the password file
              :
              :


It outputs as the above. This is an explanation of the file of /etc/passwd. Because information about the login name and the password is described in /etc/passwd, the manual about it was displayed.

In this way, it is possible to refer by switching sections when two or more manuals correspond even to a same word.


Previous Next