man
Quick Reference
Command Name:
man
Category:
system management
Platform:
linux
Basic Usage:
Common Use Cases
- 1
Manual pages
Display manual pages for commands and utilities
- 2
Documentation
Access detailed documentation for installed software
- 3
Command reference
Quickly look up command syntax and options
- 4
Learning
Learn about new commands and utilities
Syntax
man [OPTION]... [SECTION] NAME...
Options
Option | Description |
---|---|
-a, --all | Display all matching manual pages, not just the first |
-d, --debug | Display debugging information |
-e, --encoding | Specify output encoding |
-f, --whatis | Equivalent to whatis - display a short description |
-h, --help | Show the help message |
-k, --apropos | Equivalent to apropos - search for keywords in all pages |
-K, --global-apropos | Search for text in all manual pages |
-l, --local-file | Interpret PAGE as a local file name |
-m, --systems=SYSTEM | Use manual pages from other operating systems |
-M, --manpath=PATH | Set the search path for manual pages |
-p, --preprocessor=STRING | Specify preprocessors to run before nroff or troff |
-P, --pager=PAGER | Specify which pager to use |
-r, --prompt=STRING | Provide a prompt string for less pager |
-s, --sections=LIST | Use only these sections (colon-separated) |
-t, --troff | Format page using troff for printing |
-T, --device=DEVICE | Set output device for troff |
-w, --where, --path, --location | Print physical location of manual pages instead of displaying |
-W, --where-cat, --location-cat | Print physical location of cat files |
-c, --catman | Used by catman to reformat out of date cat pages |
-H, --html=BROWSER | Use specified browser for HTML display |
-X, --xwindows | Use X viewer for HTML display |
-Z, --ditroff | Format page using ditroff |
--usage | Print a short usage message |
--version | Print program version |
Examples
How to Use These Examples
The examples below show common ways to use the man
command. Try them in your terminal to see the results. You can copy any example by clicking on the code block.
Basic Examples:
man ls
Display the manual page for the ls command. This shows the complete documentation, including description, options, examples, and related information for the ls command.
man 5 passwd
Display the manual page for the passwd file format (section 5). This shows documentation about the structure and content of the /etc/passwd file rather than the passwd command, which would be in section 1.
man -k password
Search manual pages for the keyword "password". This is equivalent to the apropos command and helps you find relevant commands or topics when you're not sure of the exact command name.
man -f ls
Display a short description of the ls command. This is equivalent to the whatis command and provides a one-line summary of what the command does.
Advanced Examples:
man -a intro
Display all available intro manual pages from all sections in sequence. The -a option displays all manual pages with the given name, not just the first one found.
man -t ls | lpr
Format the ls manual page as PostScript and send it to the printer. The -t option formats the manual page for printing instead of displaying it in the terminal.