With the power of the man page command, we can see what parameters a command accepts and how to use each parameter corresponding to the command. In this way, we are more efficient when using commands.

Page Sections

Given the wide variety of commands, man solves the problem of command classification through section numbering.

1. User Commands

Section (1) is used to categorise user commands.

Such as the date command we used earlier:

img

man date result

More…

2. System Calls

Section (2) is used to categorise system call functions in the libraries provided by the Linux kernel.

img

epoll_create function provided by Linux kernel

More…

3. Library Functions

Section (3) is used to classify C language standard library functions.

img

printf function provided by standard C library

More…

4. Devices

Section (4) is used to categorise devices in the /dev directory for Linux systems.

img

"zero", a special file located in /dev directory

More…

5. Files

Section (5) is used to categorise the description of the Linux file format and covers the /proc file system.

img

/etc/os-release contains the current Linux's distribution info

More…

6. Games

Section (6) has not been used yet, so there is no appropriate example to illustrate.

img

haven't seen the command related to this section yet

More…

7. Overviews, Conventions, and Miscellaneous

Section (7) classifies some other conventional content.

img

Network API for C language

More…

8. Superuser and System Administration Commands

Section (8) categorises commands used by superusers and administrators, and this section also contains a small number of GNU C language libraries.

img

Logical Volume Manager tools creates virtual block devices based on physical devices

More…

SYNOPSIS - Options & Arguments Syntax

Required

Angle brackets(<>) means the option or argument in the brackets is required when using the related command.

Optional

Square brackets([]) means the option or argument in the brackets is an option when using the related command.

Repeatable

Ellipsis(…) means the option or argument can exist multiple times when using the related command, such as same_option1 same_option2 and so on.

Alternation

A pipe(|) means when using the related command, we must use one of the options or arguments listed around it, for example, option1|option2.

Grouping

Curly brackets({}) means the available arguments of an option when using the related command, for example, {param1,param2,param3}.

Page Layout

Layout

The layout of man is to segment information of command in pure text.

NAME

The name of the command and a brief introduction.

SYNOPSIS

The usage syntax of the command is usually described here.

DESCRIPTION

The description usually describes what the command does, including the application scenario of the command. In general, command authors often describe commands very clearly and efficiently to avoid excessive and unnecessary inquiries.

OPTIONS

Available options for this command, which are typically listed in the synopsis.

FILES

The files associated with this command, most of which are configuration files.

BUGS

Known problems and vulnerabilities.

EXAMPLE

Common usage examples.

AUTHOR

Command’s author(s).

COPYRIGHT

Command’s copyright information.

SEE ALSO

Other commands or functions associated with the command.

More…

Page Flipping

Backward Flipping - Page

We can press SPACE key to flip to the backward page.

Backward Flipping - Line

We can press ENTER key to flip to the backward line.

Forward Flipping - Page

We can press b key to flip to the forward page.

Forward Flipping - Line

We can press k key to flip to the forward line.

Page Searching

Press n key to find next one. Press N key to find previous one.

Search Backward

We can use /WORD to search backward.

Search Forward

We can use ?WORD to search forward.

Exit Page

We can press the q key to go back from man page to the interactive command line

References The Linux man-pages project, Linux man pages online, Man Page, Creating Your Own MAN Page Version 1.0

Buy me a coffeeBuy me a coffee