Guides

man command in Linux: how to read man pages, sections and man -k

How to use the man command and Linux man pages: reading and searching a page, sections 1, 5 and 8, man -k and apropos, and man pages on minimal Ubuntu.

Published ~7 min read
On this page

Short answer: man ls opens the manual page for ls in a pager: scroll with the arrow keys or Space, search with /word and n, quit with q. Pages are grouped in numbered sections, so man 5 crontab shows the file format while man crontab shows the command. man -k keyword finds pages when you do not know the name.

any Linux
man ls              # the manual page for ls
man 5 passwd        # section 5: the /etc/passwd file format, not the command
man -k "list directory"   # search names and descriptions (same as apropos)
man -f passwd       # which sections have a page called passwd (same as whatis)
man -P cat ls       # print the page without a pager, for grep or a file

Every output on this page comes from Debian 12 with man-db 2.11.2, less 590 and the manpages 6.03 package, run on 21 October 2026. cron is not installed on that host, so the crontab examples follow the cron documentation, and the Ubuntu minimal-image behaviour is described from Ubuntu’s Launchpad bug 2078583, not reproduced.

How to read a man page

Every page has the same skeleton. The top of man ls, printed with MANWIDTH=80 man -P cat ls:

Debian 12 · man ls (first lines)
LS(1)                            User Commands                           LS(1)

NAME
       ls - list directory contents

SYNOPSIS
       ls [OPTION]... [FILE]...

DESCRIPTION
       List  information  about  the FILEs (the current directory by default).
       Sort entries alphabetically if none of -cftuvSUX nor --sort  is  speci‐
       fied.
  • NAME: the name and a one-line summary. This line is what man -k and whatis search.
  • SYNOPSIS: how to call it. Per man(1), anything in [ ] is optional, ... means repeatable, a|b means one or the other, bold text is typed as shown and italic text (underlined or coloured in a terminal) is replaced by your value. ls [OPTION]... [FILE]... therefore reads: any number of options, then any number of files, all optional.
  • DESCRIPTION and OPTIONS: what it does and every flag. GNU pages list the options inside DESCRIPTION.
  • EXIT STATUS, FILES, ENVIRONMENT, EXAMPLES, SEE ALSO: not every page has all of them. SEE ALSO is the most useful for finding the related page: sleep(1) points to sleep(3), the C function.

Navigation keys

On Debian, Ubuntu and most other distributions man hands the page to less, so these are less’s keys:

KeyAction
SpaceOne screen down (also f or Page Down)
bOne screen up (also Page Up)
Down, Up, j, kOne line down or up
g, GJump to the start or the end
/patternSearch forward (a regular expression)
?patternSearch backward
n, NNext or previous match
hHelp with every key
qQuit

To jump to one option, search for it where it starts a line: /^ *-r finds the line that defines -r, not every sentence that mentions it. In a long page like man bash, searching for a heading works the same way: /^INVOCATION.

Man page sections: 1, 5 and 8

SectionContainsExample
1Commands any user can runman 1 ls
2System callsman 2 open
3Library functionsman 3 sleep
4Special files, usually in /devman 4 null
5File formats and configuration filesman 5 passwd
6Games
7Overviews, conventions, miscellaneousman 7 signal
8System administration commands, mostly for rootman 8 useradd

The same name can exist in several sections, and man without a number shows the first match in its search order, which tries section 1 first, 8 soon after and 5 near the end. man -f lists every match:

Debian 12
$ man -f passwd
passwd (1)           - change user password
passwd (1ssl)        - OpenSSL application commands
passwd (5)           - the password file
$ man -w passwd
/usr/share/man/man1/passwd.1.gz

man passwd explains the command that changes a password; man 5 passwd explains the seven fields of /etc/passwd. crontab works the same way: man crontab is the crontab -e and -l command, man 5 crontab is the format of the schedule lines, with the five time fields and the environment settings that the crontab guide walks through. When documentation writes crontab(5), the number in brackets is the section. man -a passwd shows all matching pages one after the other.

Debian 12
$ man -k "list directory"
dir (1)              - list directory contents
ls (1)               - list directory contents
vdir (1)             - list directory contents
$ apropos -s 8 "^user"
useradd (8)          - create a new user or update default new user information
userdel (8)          - delete a user account and related files
usermod (8)          - modify a user account
$ man -f sleep
sleep (1)            - delay for a specified amount of time
sleep (3)            - sleep for a specified number of seconds

(The apropos output is shortened: it also listed three unrelated pages whose one-line summary starts with “user”, because the match is not case sensitive and covers the summary too.) man -k is apropos and treats the term as a regular expression, matched against page names and the NAME line. man -f is whatis and matches whole names only. Pipe the results through grep to narrow them down; the grep guide covers the patterns. man -K word searches the full text of every page, which per the man page is brute force and slow.

“nothing appropriate” and “No manual entry”

Debian 12
$ man -k xyznotthere
xyznotthere: nothing appropriate.
$ man nosuchpage
No manual entry for nosuchpage
$ man 9 ls
No manual entry for ls in section 9

All three exit with status 16, which man(1) documents as “at least one of the pages/files/keywords didn’t exist or wasn’t matched”. If man -k misses a page that man can open, the search index is out of date. On Debian, apt usually updates it during the install (the “Processing triggers for man-db” line), the daily man-db.timer catches up later, and sudo mandb rebuilds it at once, for example after software installed outside the package manager. If a single command has no page, it may be a shell builtin: man cd answered No manual entry for cd, while help cd printed its usage.

--help vs man vs info vs tldr

SourceWhat you getBest for
cmd --helpThe option list, printed by the program itselfA quick reminder of one flag
man cmdThe full reference page, installed with the packageExact behaviour, file formats, exit codes
help cmdbash builtins such as cd, export, readCommands that are part of the shell
info cmdGNU manuals in Texinfo, often longer than the man pageGNU tools (coreutils, grep, sed, bash)
tldrCommunity-written examples, separate clientCommon usage at a glance

GNU man pages point to their longer manual at the bottom; man sleep ends with info '(coreutils) sleep invocation'. The info reader is not installed on every system (it was not on the Debian 12 host used here), but the same manual is on gnu.org. For bash builtins, Debian also ships man builtins, which is bash-builtins(7).

No man pages on a minimal Ubuntu server?

Ubuntu’s minimized images, for example the minimized option of the server installer, minimal cloud images and the ubuntu Docker image, leave out man pages and most documentation through a dpkg filter, and man answers with a message that begins “This system has been minimized by removing packages and content that are not required on a system that users do not log into”. The restore command is unminimize. Since Ubuntu 24.04 it comes in its own package, which, per Launchpad bug 2078583, is not preinstalled in releases after 24.04:

Ubuntu 24.04 and later, minimized install
sudo apt update
sudo apt install unminimize man-db
sudo unminimize

On a full install, a missing man command is fixed with sudo apt install man-db manpages; manpages-dev adds sections 2 and 3.

MANPAGER, MANWIDTH and printing a page

bash
export MANPAGER='less -i'          # case-insensitive searches in every man page
export MANWIDTH=100                # wrap at 100 columns instead of the window width
man -P cat ls > ls.txt             # plain text into a file
man ls | grep -A2 -- '--sort'      # piped output is plain text too

MANPAGER wins over PAGER, and per man(1) it may carry arguments but no pipe. When man writes into a pipe instead of a terminal, man-db 2.11 printed plain text without formatting codes (grep -c found no backspaces), so grep and wc work on it directly. Put the exports into ~/.bashrc to keep them, as described in setting environment variables.

Man pages online

The Linux man-pages project publishes its pages at man7.org, together with pages from many other projects. Those are often newer than what your distribution installed, so for an option that “does not exist” on your server, check the version first (ls --version). Debian and Ubuntu publish the pages of each release on manpages.debian.org and manpages.ubuntu.com, which match an installed system more closely.

On a Linux VPS, the local pages are the ones that match the exact versions on your server, which makes man the first stop before a web search. The Linux commands cheat sheet gives the short form of the commands worth looking up.

Frequently asked

What do the numbers in man page names like crontab(5) mean?

They are manual sections. 1 is user commands, 5 is file formats and configuration files, 8 is system administration commands. man crontab shows the crontab command from section 1, while man 5 crontab shows the format of the schedule file.

How do I search the man pages for a keyword?

Run man -k keyword, which is the same as apropos keyword. It searches page names and their one-line descriptions. man -f name, the same as whatis, lists every section that has a page of exactly that name. man -K word searches the full text, but slowly.

Why are there no man pages on my Ubuntu server?

Minimized Ubuntu images, such as the minimized server install, minimal cloud images and the ubuntu Docker image, leave man pages out. Since Ubuntu 24.04 the restore tool has its own package: sudo apt install unminimize man-db, then sudo unminimize. On a full install, sudo apt install man-db manpages brings man back.

How do I quit a man page?

Press q. man shows pages in the less pager, so Space and b page down and up, /word searches forward, n jumps to the next match and h lists every key.

Related articles

All guides