Read Linux Man Page: How to Use It
- Total time
- min
- Result
- Time to read
- 5 min
- You entered
- Pages
- 10
- You entered
To read a Linux man page, type man followed by the command name, such as man ls; the manual is then displayed in a pager (usually less) where you can scroll and search. The man page shows the command’s purpose, syntax, options, and sometimes examples, making it the primary built-in reference on Linux and Unix-like systems.
What Is a Man Page?
Man pages (short for “manual pages�) are the traditional documentation system on Unix and Linux. Each page describes one command, system call, library function, configuration file, or other component. The content is written in a markup language called troff (or groff on Linux) and rendered to plain text when you view it.
Man pages are organized into numbered sections, which help you find the right page when multiple items share a name. The most common sections are:
- 1 – User commands (e.g.,
ls,cp) - 2 – System calls (e.g.,
fork,open) - 3 – Library functions (e.g.,
printf) - 5 – File formats and configuration files (e.g.,
passwd) - 8 – System administration commands (e.g.,
mount)
If you type man passwd, you might get the user command (section 1) by default, but the configuration file (section 5) is also documented. You can specify the section: man 5 passwd.
How to Navigate a Man Page
When you open a man page, it is displayed in a pager program, typically less. Here are the essential navigation keys:
- Space or f – scroll forward one screen
- b – scroll back one screen
- Enter or e – scroll forward one line
- y – scroll back one line
- /pattern – search forward for a string (e.g.,
/-vto find the-voption) - n – repeat the search forward
- N – repeat the search backward
- q – quit the man page
You can also use the arrow keys and Page Up/Down in most terminals. The less pager is powerful: press h inside a man page to see its help summary.
Common Man Page Options
The man command itself has useful options:
man -k keyword– search the short descriptions for a keyword (equivalent toapropos). For example,man -k copylists commands related to copying.man -f command– show the sections and brief descriptions for a command (equivalent towhatis).man -a command– display all man pages for a name across sections, one after another.man -w command– print the file path of the man page without displaying it.man -t command– produce a PostScript file (for printing).
If you are unsure of the exact command name, use man -k with a keyword. For example, man -k compress will show gzip, zip, xz, and others.
Understanding the Structure of a Man Page
Most man pages follow a standard layout. Knowing this structure helps you find information quickly:
- NAME – the command name and a one-line description.
- SYNOPSIS – the command syntax, showing required and optional arguments. Brackets
[ ]mean optional; ellipsis...means repeatable. - DESCRIPTION – a detailed explanation of what the command does.
- OPTIONS – a list of flags and their meanings, often the longest section.
- EXAMPLES – some pages include usage examples.
- SEE ALSO – related man pages and commands.
Some pages also have FILES, ENVIRONMENT, DIAGNOSTICS, and BUGS sections. The BUGS section is often a candid list of known issues.
What to Do When a Man Page Is Missing
If you get “No manual entry for command,� the man page is not installed. This often happens for commands that are not part of the base system. On Debian/Ubuntu, you can install the manpages and manpages-dev packages for core documentation. For third-party tools, the package that provides the command usually also provides its man page. For example, apt install nginx will install the nginx man pages.
If you are using a minimal container or a stripped-down system, you might need to install man-db (the man page database) and less (the pager). After installing, run mandb to update the database so man -k works.
If you still cannot find a man page, the command might have its documentation in another format, such as info (GNU’s hypertext manual) or a --help flag. Many commands support --help for a quick summary, but the man page is usually more detailed.
Man Pages vs. –help vs. Info
There are three main documentation layers on Linux:
- man pages – the classic reference, detailed but sometimes terse.
- –help – a quick summary of options, available on most commands. It is useful for a fast reminder of a flag.
- info – a hypertext documentation system used by GNU tools. It often contains more tutorial-style content and can be navigated with links. To read info, type
info command.
For example, info coreutils provides a comprehensive manual for the core file utilities. Many users find info more readable, but man pages are more universal and always present.
Frequently Asked Questions
How do I exit a man page?
Press q to quit the pager and return to the shell prompt. This is the most important key to remember.
How do I search for a specific option in a man page?
Type / followed by the option name (e.g., /-v) and press Enter. Use n to jump to the next match and N to go back.
What does “SEE ALSO� mean in a man page?
It lists related commands and man pages that might be helpful. For example, man ls shows dir, vdir, and stat in SEE ALSO.
Can I read a man page without installing it?
Yes, many man pages are available online. You can search for “man page [command]� in a web browser, or use websites that mirror man pages. However, the local man page is always the most accurate for your installed version.
Why does a man page show “(1)� next to the command name?
The number in parentheses indicates the manual section. For example, ls(1) means ls is documented in section 1 (user commands). This notation is used in cross-references and in the NAME section.
How do I print a man page?
Use man -t command | lp to print a PostScript version, or man command | col -b > output.txt to save it as plain text. The col -b removes backspace formatting.
Related
Formula used
in t | Time to read | min | 5 | 0 in p | Pages | - | 10 | 1 out rate | Reading speed | pages/min | p / t | 2 out total | Total time | min | t | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.