Linux man Command: Complete Guide to Access System Manuals
The man command on Linux provides a manual for various GNU Linux commands, as well as manual pages for other third-party programs. Man offers a simplified interface for programmers to provide a manual for their programs.
Manual pages come with almost all GNU/Linux programs and can be installed according to the chosen language, if available in the distribution.
The information in man is called "Man Pages" and they provide a basic description of commands and details about how their options work.
A manual page is displayed as single text with vertical scrolling. It also documents parameters used in some configuration files.
Manual documents are divided into sections according to the topic covered. The sections are numbered from 1 to 9, as follows:
- Executable programs or shell commands;
- System Calls (functions provided by the Kernel);
- Library Calls (functions provided by the libraries);
- Special files, especially those located in /dev;
- File formats and conventions;
- Games;
- Macro packages;
- Administrative commands;
- Kernel routines.
It is possible that the same word may reference a programming function, command, or configuration file. This way it is important to know in which section we will find the desired documentation.
Each manual page is divided into parts:
- NAME: Name of the searched item with a short description;
- SYNOPSIS: Complete description of usage and syntax;
- DESCRIPTION: Brief description of functionalities;
- OPTIONS: Description of each option and arguments;
- FILES: A list of important files;
- SEE ALSO: A list of items related to the searched;
- BUGS: Description of possible problems with the item;
- AUTHOR: List of people responsible for the item.
To access the manual, the command is man followed by the searched item. Optionally, the section number can be passed as a parameter.
$ man passwd
In this example man displays the manual for the passwd command, belonging to section 1.
$ man 5 passwd
In this example, man will display the manual for the /etc/passwd file.
Navigation within manual pages is done using the following keys:
- q Exits the manual page;
- PageDown or f Scrolls 25 lines down;
- PageUP or w Scrolls 25 lines up;
- UpArrow or k Scrolls 1 line up;
- DownArrow or e Scrolls 1 line down;
- r Redraws the screen (refresh);
- p or g Beginning of the page;
- h Help about the manual page options;
- s Saves the manual page in text format to the specified file.
Learn much more about Linux in our online course. You can enroll here. If you already have an account, or want to create one, just log in or create your user here.
Liked it? Share
That was just one piece. The course teaches the whole path — from your first command to exam day.