How to get help on Linux?
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:
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:
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.
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:
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:
- Executable programs or shell commands;
- System Calls (functions provided by the Kernel);
- Library Calls (functions provided by libraries);
- Special files, especially those located in /dev;
- File formats and conventions;
- Games;
- Macro Packages;
- Administrative Commands;
- 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.
In this example, man views the manual for the passwd command, belonging to session 1.
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