How to get help on Linux? [Basic Guide]

Getting help on Linux is very easy. Linux has a set of manuals that can be used by users and administrators to consult information about the commands for help.

Linux has some user help channels, such as:

  • Command help, with the option “–help “;
  • Information pages with the” info “command;
  • System documentation in “/usr/share/doc”;
  • Manuals using the “man” command;

Command Help

Most of the commands have a little help through the “–help” option, which includes a short manual:

$ free --help 
Usage:
free [options]
Options:
-b, --bytes show output in bytes
-k, --kilo show output in kilobytes
-m, --mega show output in megabytes
-g, --giga show output in gigabytes
--tera show output in terabytes
--peta show output in petabytes
-h, --human show human-readable output
--if you use powers of 1000 not 1024
-l, --lohi show detailed low and high memory statistics
-t, --total show total for RAM + swap
-s N, -- seconds N repeat printing every N seconds
-c N, --count N repeat printing N times, then exit
-w, --wide wide output
--help display this help and exit
-V, --version output version Information and Exit

Using the Info Pages

An interesting source of consultation are the info pages. This documentation was developed by the GNU project and covers most of the project’s tools.

To access this documentation, you must use the info command followed by the name of the desired command. Here’s an example, typing the command in the shell:

# test info

The info makes it possible to navigate between related topics. To browse the info, simply find a “link” consisting of the symbol “*” and a word and press the enter key.

To move to the next page of content, type “N” (Next) and, to return, type “P” (Previous). The “q” key exits the info.

The info command without any arguments lists all existing pages.

# info

Finding the Documentation in /usr/share/doc

The /usr/share/doc directory contains much of the documentation for a Linux distribution and various applications in the form of HOWTOS, FAQs, README files, installation guides, and user manuals.

The /usr/share/doc/howto subdirectory has almost 2000 pages of documentation detailing various tasks step by step.

Here’s an example:

3Dfx-HOWTO.html AI-Alife-HOWTO.html Acer-Laptop-HOWTO.html Alpha-HOWTO.html Bash-Prog-Intro-HOWTO.html Benchmarking-HOWTO.html

This type of documentation is useful when you don’t know how to start a particular task or what tools should be used.

Information about almost all software packages installed on the system can be found in the /usr/share/doc/packages subdirectory. This information may include files with different contents such as README, INSTALL, CHANGES, INFO, FAQ, etc.

How-tos may not always be installed in the distribution, and their path may be different.

Command Manual with the man

$ man [session] command

The man command provides a manual for various GNU Linux commands, as well as a manual for other third-party programs. man offers a simplified interface for programmers to provide a manual for their programs.

The manual pages accompany almost all GNU/Linux programs and can be installed according to the language chosen, if available in the distribution.

The man’s information is called “Man Pages” and it contains a basic description of commands and details about how their options work.

A manual page is viewed as a single text with vertical scrolling. It also documents parameters used in some configuration files.

Man sessions

The documents in the manual are divided into sessions according to the subject discussed. The sessions are numbered from 1 to 9, as follows:

  1. Executable programs or shell commands;
  2. System Calls (functions provided by the Kernel);
  3. Library Calls (functions provided by libraries);
  4. Special files, especially those located in /dev;
  5. File formats and conventions;
  6. Games;
  7. Macro Packages;
  8. Administrative Commands;
  9. Kernel Routines.

It is possible that the same word may refer to a programming function, command, or configuration file. Therefore, it is important to know in which session we will find the desired documentation.

Each page of the manual is divided into parts:

  • NAME: Name of the item searched for with a short description;
  • SYNOPSIS: Full description of the use and syntax;
  • DESCRIPTION: Brief description of the features;
  • OPTIONS: Description of each option and arguments;
  • FILES: A list of important files;
  • SEE ALSO: A list of items related to the wanted;
  • BUGS: Description of possible problems with the item;
  • AUTHOR: List of people responsible for the item.

To access the manual, the command is the man followed by the item searched for. Optionally, the session number can be passed as a parameter.

$ man passwd

In this example, man views the manual for the passwd command, belonging to session 1.

$ man 5 passwd

In this example, man will display the manual for the /etc/passwd file.

Navigation within the manual pages is done using the keys:

  • q Exits the manual page;
  • PageDown or f Scroll 25 lines down;
  • PageUp or w Scroll 25 lines up;
  • Arrow Up or k Scroll 1 line up
  • ; arrow down or e Scroll 1 line down;
  • r Redesign the screen (refresh);
  • p or g Top of page;
  • h Help with the options of the manual page;
  • s Saves the manual page in text format to the specified file.

Conclusion

If you want to get help with a command on Linux, the easiest way is to use the “man” command to read the manual for the desired command.

Learn much more about Linux in our online course. You can register here. If you already have an account, or want to create one, just log in or create your user here.

Did you like it?

Share

Uirá Endy Ribeiro

Uirá Endy Ribeiro is a Software Developer and Cloud Computing Architect with a 23-year career. He has master's degrees in computer science and fifteen IT certifications and is the author of 11 books recognized in the IT world market. He is also Director at Universidade Salgado de Oliveira and Director of the Linux Professional Institute - LPI Director's Board.

Leave a Reply 0

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.

Need help?