Skip to main content
Linux offers a rich set of commands, each loaded with various options and switches. At first, it may seem challenging to remember every option, but as you use each command, its functionality gradually becomes second nature. In the meantime, Linux provides several ways to access help manuals and documentation directly from the command line.

Using the —help Option

When you only need a quick reminder of command options, the --help flag is your best friend. For example, if you want to see the long listing format for the ls command but can’t remember the correct flag, simply run:
Scrolling through the output helps you locate the specific flag you need—in this instance, -l.

Exploring More Complex Help: The Journalctl Example

Certain commands offer more detailed information beyond a brief overview. The journalctl command, used for querying system log files, is one such example. When you run:
you will notice that the output opens in a pager—a text viewer that lets you scroll up and down using the arrow keys or the page up/page down keys. To exit the pager, simply press Q.

Accessing Manual Pages

Linux provides comprehensive manual pages for most commands, accessible with the man command. For instance, to read about journalctl, run:
This command displays the manual page, typically structured with the following sections:
  • NAME: A brief description of the command.
  • SYNOPSIS: The command syntax.
  • DESCRIPTION: An in-depth explanation of command functionality.
  • OPTIONS: A detailed list of command options.
  • EXAMPLES: (Occasionally) practical usage examples.
Below is an image showcasing a terminal window displaying the manual page for the journalctl command, including sections such as NAME, SYNOPSIS, and DESCRIPTION.
The image shows a terminal window displaying the manual page for the journalctl command, which is used to query the systemd journal. It includes sections like NAME, SYNOPSIS, and DESCRIPTION.
Some commands have multiple manual pages due to overlapping names. For example, printf exists both as a command and a programming function. Manual pages are divided into sections, and you can specify which one to view. To see the manual page for the printf command, use:
In contrast, to view the manual page for the printf function, run:
For a breakdown of the manual page sections, refer to the manual for man itself:

Searching for Commands with Apropos

At times, you might forget the specific command you need, such as the one for creating a new directory. The apropos command searches through manual pages by examining their short descriptions. To search for manual pages that mention “directory,” run:
Using a term like “director” instead of “directory” broadens your search and can match entries with “directories” as well. If you encounter an error because the apropos database hasn’t been built, you can create it manually with:
After updating the database, running apropos generates multiple entries, including those for mkdir. To filter the search results to only include commands (typically found in sections 1 and 8), use the -s option:
Remember that using more generic search terms like “director” can yield additional relevant entries.

Using Autocompletion

Autocompletion can significantly speed up your work at the command line. For instance, if you start typing “system c” and press the TAB key, the shell will automatically complete it to systemctl. Many commands also provide suggestions when you press TAB twice. For example, typing systemctl followed by a space and pressing TAB twice may present a list of available subcommands:
Autocompletion similarly works for file and directory names. For example, typing:
and pressing TAB auto-completes to /usr/. Hitting TAB again typically displays the available directories in /usr/ without the need for an explicit ls command:
For longer filenames, such as wordpress_archive.tgz, typing a few unique characters and pressing TAB will quickly complete the name.

Final Recommendations

While man pages and --help options offer extensive information about commands, they might not always provide complete clarity at first glance. Select an unfamiliar command and explore its usage solely through its manual and help output. This practice is especially valuable for exam settings such as the LFCS exam, where quickly locating documentation can be a game changer.
Here is one final example for listing the contents of the /usr/ directory:
Now, it’s time to apply what you’ve learned. Happy exploring!

Watch Video