Linux man Command: Built-In System Help Guide

The man command in Linux serves as the primary interface for accessing the operating system's built-in reference documentation, commonly known as manual pages. This article explains the core purpose of the man command, how it acts as an essential offline reference tool, the structure of its documentation, and the basic techniques required to navigate and search manual pages effectively.

The Purpose of the man Command

The fundamental purpose of man (short for "manual") is to provide comprehensive, authoritative, and offline documentation directly from the terminal. Unlike web searches, which may describe different software versions or distributions, the man command displays the exact documentation corresponding to the software versions installed on your specific machine. It covers shell commands, system calls, library functions, special files, file formats, and system administration utilities.

Basic Syntax and Operation

To view documentation for any tool or configuration file, run the command followed by the name of the utility you want to inspect:

man <command_name>

For example, running man ls opens the complete manual for the directory listing utility.

By default, the man command uses a terminal pager (typically less) to display output one screen at a time. Standard navigation keys include:

Structure of a Manual Page

Linux manual pages follow a standardized layout, making it easy to locate specific information quickly:

Manual Sections

The documentation is divided into numbered sections to distinguish between commands, configuration files, and programming functions that share the same name:

  1. Section 1: General user commands (e.g., ls, grep, tar).
  2. Section 2: System calls provided by the Linux kernel.
  3. Section 3: Library functions (C standard library).
  4. Section 4: Special files (usually devices in /dev).
  5. Section 5: File formats and configuration files (e.g., /etc/passwd).
  6. Section 6: Games and screensavers.
  7. Section 7: Miscellaneous overviews and conventions.
  8. Section 8: System administration and root-level commands (e.g., fdisk, useradd).

If a command exists in multiple sections, you can specify the section number. For instance, running man 1 passwd displays the user command for changing passwords, whereas man 5 passwd documents the configuration format of the /etc/passwd file.

Finding the Right Manual

If you do not know the exact command name, you can search manual titles and short descriptions using the -k (keyword) option:

man -k <keyword>

This functions identically to the apropos command. For example, running man -k "copy files" returns a list of utilities capable of copying data, helping you identify the proper tool before opening its dedicated manual page.