Skip to main content

Top 5 Linux man command options for browsing man pages

My five favorite options for getting the most from the man command.
Image by Dean Moriarty from Pixabay

Searching through the seemingly endless repository of information online has been, and always will be, a useful tool in the pocket of any sysadmin. The vast archive of collective wisdom and shared experiences is a tribute to The Open Internet. Having access to such a huge repository of information is not something any sysadmin takes for granted. That said, there are certainly advantages to knowing how one can find answers to a problem without having to rely on the World Wide Web for every question or problem. For one, you might find yourself working in an air-gapped environment in which access to the Internet isn't possible. Or, if you have ever sat a Red Hat exam, you're aware that access to the Internet is also not an option, and knowing how to look things up fast may mean the difference between a pass and no pass result.

[ You might also like: 6 options for tcpdump you need to know ]

This leads me to the topic of this article, the man command, which I believe is one of the simplest yet most important commands available to any sysadmin. Why? Because in many cases, it's the first step toward finding the solution to a problem. And knowing how best to leverage the man command might accelerate finding an answer.

Before I jump into my top five options for man, it’s important to mention that man pages are divided up into several sections based on areas that they cover:

  • 1 - Executable programs or shell commands
  • 2 - System calls (functions provided by the kernel)
  • 3 - Library calls (functions within program libraries)
  • 4 - Special files (usually found in /dev)
  • 5 - File formats and conventions, e.g. /etc/passwd
  • 6 - Games
  • 7 - Miscellaneous (including macro packages and conventions), e.g., man(7), groff(7)
  • 8 - System administration commands (usually only for root)
  • 9 - Kernel routines [Non-standard]

Being aware of these sections may help you when trying to narrow down your search criteria. The above table was pulled straight from man's own man page, which you can view with the command man man.

Now, on to my top five options.

Top five options

Here are my favorite options for the man command. These will help you get the most from this simple but powerful command.

List all available man pages on the system and provide a short description.

$ man -k .

Output a short description of the specified man page. Keyword must be the exact name of a man page.

$ man -f <keyword>

Example: man -f virt-manager

Search through all man pages using regular expressions and open the matching man pages one after the other. This works well when combined with the -wK options described below.

$ man --regex <keyword>

Example: man --regex ".*network$"

This is good for narrowing down the search criteria to specific sections. Multiple sections can be defined as comma-separated-values, and this option also works best when combined with --regex.

$ man -S <section ID> <keyword>

Example: man -S 1 --regex "^virsh"

This is my personal favorite. Use this to search through all man pages on a system for the specified keyword and output the location of any man pages that contain that keyword. Powerful when used with --regex.

$ man -wK <keyword>

Example: man -wK --regex "ipv4.*listen"

Wrap up

Often, the answer to a question is hiding in the documentation that already exists on your system. Understanding the tools at your disposal is key to reaching a speedy resolution and the man command is one of those tools that can help you get there.

Check out these related articles on Enable Sysadmin

Author’s photo

Thomas Tuffin

Thomas is a Technical Account Manager for Red Hat. An Aussie expat in Sweden, he is passionate about Open Source software and has a keen interest in emerging technologies such as blockchain. More about me

Red Hat Summit 2022: On Demand

Get the latest on Ansible, Red Hat Enterprise Linux, OpenShift, and more from our virtual event on demand.

Related Content


Privacy Statement