How to Access Man Pages in Linux

How to Access Man Pages in Linux

The quickest way to access man pages in linux is to open a terminal and type man followed by the command name, for example man ls. That opens the manual page for the command, where you can read usage, options, examples, and related documentation.

What are man pages?

Man pages, short for manual pages, are built-in documentation for Linux and Unix-style systems. They explain how commands work, what options they accept, and often include notes about files, environments, return values, and examples.

If you are learning the command line or trying to understand an unfamiliar command, man pages are usually the first place to look. They are written in a standard format, which makes them consistent across many tools.

How to open a man page

How to open a man page

To open a manual page, use this basic syntax:

man command_name

Examples:

man ls
man grep
man cd

If the command has a manual page installed, it opens in a pager, usually less. That means you can scroll through the document instead of seeing everything at once.

Open a specific section when needed

Some names appear in more than one manual section. In that case, you can specify the section number explicitly:

man 5 passwd
man 2 read
man 1 printf

This is useful when the same word refers to both a command and a configuration file or system call.

How to navigate inside man

When a man page opens, you are inside a text viewer. The most common controls are simple and keyboard based.

ActionKey or command
Scroll down one lineDown arrow or Enter
Scroll up one lineUp arrow
Move down one pageSpacebar or Page Down
Move up one pagePage Up or b
Search forward/ followed by text
Repeat searchn
Go back to previous search resultN
Exit the manual pageq

For most users, the most important key is q, which quits the man page and returns you to the terminal.

How to search within a man page

How to search within a man page

If a manual page is long, search inside it instead of scrolling line by line.

  1. Open the page with man.
  2. Type / and then your search term.
  3. Press Enter.
  4. Use n to jump to the next match.

Example:

man grep

Then type:

/ignore-case

This is especially helpful for finding options, environment variables, or section headings quickly.

How to find the right command when you do not know the exact name

How to find the right command when you do not know the exact name

If you know what you want to do but not the exact command name, use apropos or man -k to search manual page descriptions.

apropos network
man -k network

Both commands look through short descriptions from installed man pages and list matches. This is useful when you are trying to discover the right tool before opening its manual.

You can also use whatis for a brief one-line summary of a command:

whatis ls

A practical workflow looks like this:

  1. Use apropos or man -k to find a likely command.
  2. Open its manual with man command_name.
  3. Search inside the page with / if you need a specific option.

How man page sections work

Linux manual pages are organized into sections. Knowing the sections helps when a name appears more than once.

SectionTypical content
1User commands and programs
2System calls
3Library functions
4Special files and device files
5File formats and conventions
6Games and screensavers
7Miscellaneous and overview topics
8System administration commands

For example, passwd may have a user command page in section 1 and a file format page in section 5. If you want the file documentation, you would run man 5 passwd.

What to do if a man page is missing

What to do if a man page is missing

If man says a page is not found, the cause is usually one of these:

  • The manual page is not installed on your system.
  • You typed the command name incorrectly.
  • The documentation package is missing, especially on minimal installations.
  • The page exists in a different section than the one you expected.

Try these checks:

  1. Confirm the command name with which command_name or by checking your shell history.
  2. Search for related entries with apropos keyword.
  3. Try a specific section, such as man 8 command_name or man 5 filename.
  4. Install the relevant documentation package if your distribution separates man pages from the main program.

On some systems, especially minimal servers or container images, man pages are intentionally absent until you install the manual database or documentation packages.

Helpful man command options

These options can make man pages easier to use:

  • man -f command, similar to whatis, shows a short summary.
  • man -k keyword, similar to apropos, searches descriptions.
  • man -a command opens all matching sections one by one.
  • man section command opens a specific section directly.

Example:

man -a printf

This can be useful when you want to review every manual entry for the same name.

Quick man command cheat sheet

Use this as a fast reference when working at the terminal:

  • man ls , open the manual for ls
  • man 5 passwd , open a specific section
  • /word , search inside the manual page
  • n , jump to the next search match
  • q , quit the man viewer
  • apropos keyword , search manual page descriptions
  • man -k keyword , same idea as apropos
  • whatis command , show a one-line summary
  • man -f command , same idea as whatis

Frequently Asked Questions About how to access man pages in linux

How do I open a man page in Linux?

Type man followed by the command name, such as man pwd or man grep.

How do I exit a man page?

Press q to quit and return to the terminal.

How do I search for a command in man pages?

Use apropos keyword or man -k keyword to search descriptions across installed manual pages.

What does the section number in man pages mean?

The section number tells you what kind of documentation you are opening, such as user commands, system calls, or file formats.

Why is a man page not found?

The page may not be installed, the command name may be wrong, or the documentation may live in a different section.

What is the difference between man and apropos?

man opens the full manual page for a specific topic, while apropos searches short descriptions to help you find the right topic first.

Conclusion

If you want to know how to access man pages in linux, the main command is simple: use man in the terminal, then add the command or topic you want to read about. Once the manual opens, you can scroll, search, and quit with a few basic keys. Learning apropos, whatis, and manual sections makes it much easier to find the right documentation when you are not sure what to look for.

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *