X
Tech
Why you can trust ZDNET : ZDNET independently tests and researches products to bring you our best recommendations and advice. When you buy through our links, we may earn a commission. Our process

'ZDNET Recommends': What exactly does it mean?

ZDNET's recommendations are based on many hours of testing, research, and comparison shopping. We gather data from the best available sources, including vendor and retailer listings as well as other relevant and independent reviews sites. And we pore over customer reviews to find out what matters to real people who already own and use the products and services we’re assessing.

When you click through from our site to a retailer and buy a product or service, we may earn affiliate commissions. This helps support our work, but does not affect what we cover or how, and it does not affect the price you pay. Neither ZDNET nor the author are compensated for these independent reviews. Indeed, we follow strict guidelines that ensure our editorial content is never influenced by advertisers.

ZDNET's editorial team writes on behalf of you, our reader. Our goal is to deliver the most accurate information and the most knowledgeable advice possible in order to help you make smarter buying decisions on tech gear and a wide array of products and services. Our editors thoroughly review and fact-check every article to ensure that our content meets the highest standards. If we have made an error or published misleading information, we will correct or clarify the article. If you see inaccuracies in our content, please report the mistake via this form.

Close

What are man pages and why are they important to your Linux education?

If you've had someone tell you to RTFM, depending on what software you are using, that manual might be a challenge to find. On Linux, however, you'll find hundreds upon hundreds of manuals ready to view. Jack Wallen explains.
Written by Jack Wallen, Contributing Writer

As you begin your journey with Linux, you'll find things are far easier than you originally assumed. This is especially so on the desktop, where everything is a point-and-click affair and you could go your entire life without ever having to touch the command line. 

That's a far cry from when I first started my Linux journey (back in '96), at which point the terminal was an absolute necessity. Nearly everything I did required some level of command-line usage.

Also: How to install Ubuntu Linux (It's easy!)

Because of that, I spent a good amount of time RTFMing (look it up) my way through Linux. Thankfully, there has almost always been a built-in system for reading those manuals, called man pages. 

What are man pages?

Man pages are simply manual pages created to help users understand how commands are used in Linux. These pages are installed, by default, alongside the commands. As long as the software developer created a man page, it'll be there to help explain how to use a specific command.

What's interesting about this system is that it depends on a command itself. That command is man, which serves as an interface to the system reference manuals.

Man pages are laid out fairly in a fairly simple fashion but can be a bit daunting at first. Let's break down the structure of these pages.

The structure of a man page

Man pages are all laid out with specific sections, which include:

  • NAME - the name of the command in question.
  • SYNOPSIS - the structure of the command.
  • DESCRIPTION - a description of the command.
  • OPTIONS - available options for the command.
  • AUTHOR - the author of the command.
  • REPORTING BUGS - instructions on reporting bugs to the developer(s).
  • COPYRIGHT - information about command license.
  • SEE ALSO - points to full documentation or related commands.
  • CONFIGURATION - configuration details for a command or device.
  • EXIT STATUS - possible exit status values.

Not every man page will include every section you see above, but they most always have the basics (NAME, SYNOPSIS, OPTIONS), so you can get up to speed on the command. Some man pages even include examples of how the command is used and many man pages will list out every single option available to the command. 

How to view a man page

Let's say you want to find out all the options available for the ls command. For that, issue the command man ls, which will open the manual page (Figure 1).

The manpage for the ls command in Linux.

Viewing the manual page for the ls command.

Image: Jack Wallen

As you can see, the ls man page lays out the structure of the command in the SYNOPSIS section as such:

ls [OPTION] … [FILE] …

What that means is this:

  • ls - the command to be used.
  • [OPTION] - options you want to pass to the command.
  • [FILE] - the file you want to use ls with.

Of course, not every command requires options and/or files. For instance, you could run the ls command in any directory (sans options or files) to view a listing of files. Unfortunately, not every man page makes the clear, so you might have to figure that one out for yourself (or with the help of ZDNet…or Google).

Once you have the man page open, you can scroll through either using the space bar (to scroll one page at a time) or the arrow keys on your keyboard (to scroll one line at a time).

Man Sections

This is where man pages do get a bit confusing. Some man pages are comprised of sections, each of which describes a different aspect of the command. This is especially so when a man page is considerably more complicated or if there are related commands. 

For example, if you want to view the man page for the man command (it exists), you'd issue the command man man. Scroll through that and you'll find a reference that looks like man(7), which means there are more sections to view. 

To view a specific section of a man page, you'd issue the command man 7 man, which will display section 7 of the man manpage. To find out the different sections in the man manpage, issue the command man -f man, which will display two sections (Figure 2).

The sections of the man manpage.

A list of the man manual page sections.

Image: Jack Wallen

Not every man page will have multiple sections. For example, issue the command man -f ls and you'll see only one section listed. The mkdir man page includes two sections:

  • mkdir (1) - make directories

  • mkdir (2) - create a directory

Seems to me that make and create are the same thing. If you issue the command man 1 mkdir you'll see a manpage that describes how to use the mkdir command. Issue the command man 2 mkdir the difference becomes quite clear. The 1 section is about how users can make use of the command, whereas the 2nd section is about how developers can use the command. In fact, it states it very clearly at the top of each page:

  • mkdir(1) - User Commands

  • mkdir(2) - Linux Programmer's Manual

In other words, the first section targets users, and the other sections target developers. That's not always the case but it's a fairly safe bet.

Finding the right man page

Another very handy trick with man pages can help you find the man page you're looking for. Say, you know there's a grep-adjacent command, but you can't remember what it's called. If you issue the command man -k grep, you'll see a listing of all man pages that contain the phrase "grep" in their name (Figure 3).

Figure 3

A list of all related manpages to the grep command.

All of the grep-adjacent man pages.

Image: Jack Wallen

By using this feature, you might be able to locate that man page, even if you can't remember the exact name of the command.

And that's all there is to using man pages in Linux. If you're a casual desktop user, you might never have to touch this help system. If, however, you plan on eventually moving up the ladder of Linux usage (such as server administration), the man command could easily become your best tech friend.

Editorial standards