How to View Manual Pages in Ubuntu?
To view the manual page for a specific command in Ubuntu Linux, you
use the man command followed by the name of the command you
want to research. This article covers how to use the man
command, how to navigate through the manual interface, and how to find
specific sections or search for commands when you cannot remember their
exact names.
Using the man Command
The man command is the standard interface for accessing
the built-in reference manuals on Ubuntu. It provides detailed
documentation on command syntax, available options, environment
variables, and usage examples.
To open a manual page, open your terminal and type man
followed by the target command:
man lsRunning this example opens the manual page for the ls
(list directory contents) command, displaying its full documentation
directly in your terminal window.
Navigating the Manual Page
The manual viewer uses a terminal pager (typically less)
to display content. You can navigate through the text using the
following keyboard shortcuts:
- Up/Down Arrow Keys: Scroll up or down by one line.
- Spacebar: Scroll down by full page.
- B: Scroll back up by one page.
- Home/End: Jump to the very beginning or the end of the document.
- Q: Quit the manual page and return to the standard terminal prompt.
Searching Within a Manual Page
If you are looking for a specific option or keyword inside a long manual page, you can search the text dynamically:
- Press the forward slash key (
/) while the manual is open. - Type the keyword or flag you want to find (for example,
/recursive). - Press Enter to execute the search.
- Press N to move to the next match, or Shift + N to move to the previous match.
Finding Commands by Keyword
If you do not know the exact name of the command you need, you can
search the short descriptions of all manual pages using the
-k option (which functions similarly to the
apropos command).
man -k "copy"This output displays a list of all commands related to the word “copy”, helping you identify the exact command name before viewing its specific manual page.