On this page
- Is the manual installed on your server?
- How do you open and read a man page?
- What do the section numbers mean?
- How do you find a command when you do not know its name?
- What other built-in help is there?
- How do you find out which package or file a page belongs to?
- How do you save or share a page?
- How can you make man pages easier to read?
- Why does man show nothing or the wrong page?
- Questions
Is the manual installed on your server?
Check with man ls. If it opens, you are set. If you see "No manual entry" or a note that the system has been minimised, add the tools and documentation.
# Ubuntu / Debian
sudo apt update && sudo apt install -y man-db manpages manpages-dev
# Rocky Linux 9 / AlmaLinux 9
sudo dnf install -y man-db man-pages
man --versionUbuntu images built in minimal mode exclude files under /usr/share/man through a dpkg rule. Running sudo unminimize removes that rule and reinstalls the missing documentation. On Ubuntu 24.04 the command comes from the unminimize package, so install it first if the shell cannot find it. On Debian and the EL9 systems, installing the packages above is enough.
How do you open and read a man page?
Run man with the program name. The page opens in the less pager, so the same keys apply as when you read files with less.
man ss
man 5 sshd_config
man -f passwd- Space or f: next page; b: previous page.
- /text: search forward; n and N repeat the search.
- g and G: top and bottom.
- h: pager help; q: quit.
Pages follow a fixed layout: NAME, SYNOPSIS (the syntax, with optional parts in square brackets), DESCRIPTION, OPTIONS, often EXAMPLES, then FILES and SEE ALSO. Jumping to EXAMPLES with /^EXAMPLES is often the fastest route to a working command.
What do the section numbers mean?
The manual is split into numbered sections, and the same name can exist in several. That is why passwd has both a command page and a file format page.
- 1: user commands (ls, grep, ssh)
- 2 and 3: system calls and library functions, for programmers
- 5: file formats and config files (crontab, sshd_config, fstab)
- 7: overviews and conventions (regex, signal, systemd.special)
- 8: administration commands (useradd, ip, sshd)
man 1 passwd # the command
man 5 passwd # the /etc/passwd format
man -a passwd # every page with that name, one after anotherWhen people write crontab(5) in docs, they mean section 5 of the crontab page.
How do you find a command when you do not know its name?
Search the page descriptions with apropos (the same as man -k). It matches words in the NAME line of each page.
apropos "time zone"
man -k ^user
apropos -s 8 firewall
sudo mandb # rebuild the search index after installing packagesIf apropos returns "nothing appropriate", the index has not been built yet; sudo mandb fixes that and normally runs on a daily timer anyway. The -s 8 flag limits results to administration commands, which cuts the noise on a busy system.
What other built-in help is there?
Most programs print a short summary with --help, which is faster than the full manual when you only need a flag name.
ss --help | less
help cd # Bash builtins have no man page of their own
type -a cd
info coreutils "wc invocation"
ls /usr/share/doc/openssh-server/Shell builtins such as cd, export and read are documented by Bash itself, so use help for them, or search inside man bash. GNU tools also ship longer info manuals; info needs the info package on Debian and Ubuntu. Package docs, changelogs and sample configs live in /usr/share/doc.
How do you find out which package or file a page belongs to?
Print the file path with man -w, then ask the package manager who owns it. This tells you which package to reinstall if a page goes missing.
man -w sshd_config
dpkg -S "$(man -w sshd_config)" # Ubuntu / Debian
rpm -qf "$(man -w sshd_config)" # Rocky / AlmaThe same trick works for any file on the system, which helps when you are cleaning up or auditing a server.
How do you save or share a page?
Pipe the page through col -b to strip formatting, and you get plain text you can grep, store or paste into a ticket.
man rsync | col -b > ~/rsync-manual.txt
man rsync | col -b | grep -n -A3 -- "--delete"
MANWIDTH=80 man tar | col -b | lessMANWIDTH fixes the line width, useful when your SSH window is very wide. The -- before the search term tells grep that the pattern starting with dashes is not an option of its own.
How can you make man pages easier to read?
Set the pager options so long pages are pleasant over SSH. Add these lines to ~/.bashrc:
export MANPAGER="less -R --use-color -Dd+r -Du+b"
export MANROFFOPT="-c"The colour flags need a less release from 2021 or later, which all four systems ship; if an older pager complains, drop --use-color and the -D options and keep less -R. Read more about shell startup files in aliases and a tidy .bashrc.
Why does man show nothing or the wrong page?
- "No manual entry for X": either the docs were stripped (see the install section) or the program came from outside the repository, such as a static binary in
/usr/local/bin. TryX --help. - Wrong page opens: add the section number, for example
man 5 crontabinstead ofman crontab. - apropos finds nothing: run
sudo mandb. - Garbled symbols: set a UTF-8 locale;
localeshould showC.UTF-8oren_US.UTF-8.
Plans that fit this guide
Base city prices. Every plan includes a dedicated IPv4 address, IPv6, full root and all 18 images.
| Plan | Fits because | Size | Monthly | Order from |
|---|---|---|---|---|
| S1-2 | documentation and learning need very little capacity | 1 vCPU, 2 GB RAM, 55 GB SSD | $6.00/mo | $72.00 for 12 months |
Questions about Read manual pages
Are man pages up to date with the installed version?
Yes, they come from the same package as the program, so they describe the version installed on your server, which online docs for a newer release may not.
How do I read a man page file that is not installed?
Pass the path directly: man ./tool.1 renders a local page file, which is useful for software you built from source.
Does FreeBSD use the same man command?
It has its own man with the same idea and the same section numbers, and its manual is installed by default. This guide covers the Linux images.
Is tldr a replacement for man?
The community tldr pages give short examples and are a nice companion, but they are not complete. The man page remains the reference for every option.
How do I print the list of all pages in section 8?
Run man -k . -s 8. It prints every page in that section with its one-line description.
More in Linux command line
- Copy files and directories with cp
- Move and rename with mv
- Create directories and empty files
- List files with ls, find your place with pwd
- Read files with cat, less and tail
- Find files with find and locate
- Search text with grep
- Edit and report text with sed and awk
- echo, tee and wc
- Edit files with nano
- Edit files with Vim
- Users and groups
- Ownership with chown and chgrp
- Symbolic and hard links
- Pipes, redirection and xargs