'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.
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.
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.
Man pages are all laid out with specific sections, which include:
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.
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).
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:
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).
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).
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.
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).
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.