When you are working in the Ubuntu terminal, it is impossible to memorise every single command, flag, and option for the hundreds of software packages installed on your system. If you forget how to use a specific command like wget or tar, you might be tempted to leave the terminal and search the internet for a tutorial.
However, almost every command-line program installed on an Ubuntu server comes with its own extensive, built-in documentation. You can access this official documentation instantly without an internet connection by using the man command, short for “manual.”
How to Open a Manual Page
Opening a manual page (often called a “man page”) is incredibly straightforward.
- Open your Ubuntu terminal.
- Type
manfollowed by a space, and then the name of the command you want to learn about. For example, if you want to learn how to use the “curl” command, type:man curl - Press Enter.
Your terminal window will instantly transition into a reading interface, displaying the official documentation for the requested command.
How to Read and Navigate the Manual
Man pages are traditionally displayed using a program called less, which allows you to scroll through large text files comfortably without cluttering your main terminal history.
Because you are in a reading environment, you must use specific keyboard shortcuts to navigate:
- Arrow Keys (Up/Down): Scroll through the document one line at a time.
- Spacebar: Jump forward exactly one full page.
- b (Key): Jump backward exactly one full page.
- g (Key): Jump instantly to the very top of the manual.
- G (Shift + g): Jump instantly to the very bottom of the manual.
- q (Key): Quit the reader and return to your standard terminal prompt.
How to Search Within a Manual Page
Some manual pages (like the one for the find command) are thousands of lines long. Scrolling through them manually to find a specific feature is a waste of time. You can use the built-in search function to find exactly what you need.
- While viewing a man page, press the forward slash key
/. You will see the slash appear at the bottom-left corner of the screen. - Type the word you are looking for (e.g.,
/timeout) and press Enter. - The reader will instantly jump to the first instance of that word, highlighting it on the screen.
- To jump to the next instance of that same word, simply press the n key on your keyboard.
- To jump backward to the previous instance of the word, press Shift + n (capital N).
Understanding the Structure
When you open a man page, you will notice it follows a strict, universal layout to help you find information quickly. The most important sections to look for are:
- NAME: A one-sentence description of what the program actually does.
- SYNOPSIS: A technical breakdown showing the exact mathematical order in which you must type the command and its arguments.
- DESCRIPTION: A detailed explanation of how the program works.
- OPTIONS: The largest section, providing a comprehensive list of every single flag (like
-aor--verbose) you can attach to the command to change its behaviour.