Skip Navigation

Linux Documentation

Although it’s normally possible to look up documentation on the Internet, it is often quite convenient to have local copies of manual pages and other documents available.

Page Contents

Understanding Documentation

Documentation for Linux systems generally falls into two categories:

  1. Manual pages, and
  2. Text files and sample configurations.

On systems that use GNU tools, there is also “texinfo” documentation, but we aren’t using those tools in our Alpine Linux installation.

While text files and other samples will vary by program, manual pages typically have a common format and are a widely used way of documenting commands, C library functions, and configuration formats. Manual pages are accessed using the man command, and the manual is broken into numbered sections:

Section Contains documentation for
1 Commands used on the command line
2 System calls (normally used by C code)
3 C standard library (functions)
4 Drivers and special files
5 Configuration file formats
6 Games
7 Miscellaneous help documents
8 System administration commands and services

By convention, documentation frequently lists commands with the manual section in parentheses following the command. For example, documentation about the doas command might refer to doas(1). This notation means that doas is a command that is documented in section 1 of the manual.

Similar notation is also used for configuration files. For example, doas.conf(5) means that the documentation for the /etc/doas.conf file may be found in section 5 of the manual, under the name “doas.conf”. Even C library functions are documented this way. For instance, qsort(3) means the C standard library quicksort implementation, the details for which can be found in section 3 of the manual.

Installing Documentation

On Alpine Linux, documentation can be installed by running:

doas apk add mandoc mandoc-apropos docs

If you’re running the Z shell as your regular user, make the man and apropos commands available in your current session by instructing the shell to re-scan the system for available commands:

rehash

Accessing Documentation

To view a manual page, use the man command, which takes the (optional) section number followed the name of the manual page to display. The section number is only important if there is a page with the same name in more than one section of the manual. For example, running:

man apk

will display the manual page for the apk command, which is in section 8 of the manual. Since there isn’t an apk manual page in any of the other sections, the above command works. However, we could also be more explicit:

man 8 apk

To move around a manual page, use the arrow keys. To exit, press the letter q (for quit).