Finding Help in Linux: Local Documentation Guide
Linux documentation is quite complete and can provide some very interesting help. You don't need Google to know how a certain command works or "how to" do something
First, some definitions about terms used for documentation are necessary:
- HOWTOs: How To – These are documents that detail the procedures to complete a specific task;
- Man: Manual Page – These are traditional manuals that cover a very wide variety of topics;
- Info: Info Pages – Documentation provided by the Free Software Foundation for GNU software;
- LDP: Linux Documentation Project – A project to create and distribute documentation about Linux.
Finding Documentation in /usr/share/doc
The /usr/share/doc directory contains most 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 step by step various tasks.
See 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 certain task or which tools should be used.
In the /usr/share/doc/packages subdirectory you can find information about almost all software packages installed on the system. This information may include files with different contents such as README, INSTALL, CHANGES, INFO, FAQ, etc.
HOWTOs may not always be installed in the distribution, and their path may be different.
Using Info Pages
An interesting source of reference are the info pages. This documentation was developed by the GNU project and covers a large part of the project's tools.
To access this documentation, you need to use the info command followed by the name of the desired command. See an example, typing the command in the shell:
# info test
Info allows navigation between related topics. To navigate in info, just find a "link" which is formed by the "*" symbol and a word and press the Enter key.
To go to the next page of the content, type "N" (Next) and, to go back, type "P" (Previous). The "q" key exits info.
The info command without any arguments lists all existing pages.
# info
Using Manual Pages
Manual pages come with almost all GNU/Linux programs. They provide a basic description of commands and details about how their options work.
A manual page is viewed as single text with vertical scrolling. It also documents parameters used in some configuration files.
Manual documents are divided into sections according to the subject covered. The sections 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 the 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 reference a programming function, command, or configuration file. This way it is important to know in which section we will find the desired documentation.
Each manual page is divided into parts:
- NAME: Name of the searched item with a short description;
- SYNOPSIS: Complete description of usage and syntax;
- DESCRIPTION: Brief description of functionalities;
- OPTIONS: Description of each option and arguments;
- FILES: A list of important files;
- SEE ALSO: A list of items related to the searched item;
- BUGS: Description of possible problems with the item;
- AUTHOR: List of people responsible for the item.
To access the manual, the command is man followed by the searched item. As an option, the section number can be passed as a parameter.
# man passwd
In this example man displays the manual for the passwd command, belonging to section 1.
# man 5 passwd
In this example man will display the manual for the /etc/passwd file.
Navigation within manual pages is done using the keys:
- q Exits the manual page;
- PageDown or f Scrolls 25 lines down;
- PageUP or w Scrolls 25 lines up;
- UpArrow or k Scrolls 1 line up;
- DownArrow or e Scrolls 1 line down;
- r Redraws the screen (refresh);
- p or g Beginning of page;
- h Help about manual page options;
- s Saves the manual page in text format to the specified file.
Using Online Help
The quick help feature is useful to know which options can be used with a certain command. Almost all GNU/Linux programs offer this feature for quick queries. To invoke online help, type:
# [command] —help
For example:
# ls —help
Want to know if a certification is worth it? Find out why salaries are good, and why companies are looking for Linux professionals.
You will understand that the benefits far outweigh the sacrifice.
And if you have already decided, check out our Certification Guide.
And if you want to know where to take the exams, check the city list.
If you want to know the exam language, see this post.
Learn much more about Linux in our online course. You can enroll here with a 7-day free trial. If you already have an account, you can access here.
Like it? Share :-)
That was just one piece. The course teaches the whole path — from your first command to exam day.