Linux Man Pages | Directories for Man Pages | LFCS Exam Question

Linux Man Pages

Question

In compliance with the FHS, in which of the directories are man pages found?

Answers

Explanations

Click on the arrows to vote for the correct answer

A. B. C. D. E.

A

The FHS (Filesystem Hierarchy Standard) is a standard directory structure for Unix and Unix-like operating systems. It defines the locations of directories and files on the system, as well as their purposes.

According to the FHS, manual pages (or "man pages" for short) are typically located in the /usr/share/man directory. This directory contains subdirectories for different types of documentation, such as:

  • /usr/share/man/man1 for executable programs and shell commands
  • /usr/share/man/man2 for system calls
  • /usr/share/man/man3 for library functions
  • /usr/share/man/man4 for special files and drivers
  • /usr/share/man/man5 for file formats and protocols
  • /usr/share/man/man6 for games
  • /usr/share/man/man7 for miscellaneous documentation
  • /usr/share/man/man8 for system administration commands

Within each of these directories, the actual manual pages are stored in compressed files with names like <command>.<section>.gz, where <command> is the name of the command or function being documented, and <section> is the section number (1-8) that corresponds to the type of documentation.

For example, the manual page for the ls command would be stored in the file /usr/share/man/man1/ls.1.gz, while the manual page for the fopen() function would be stored in /usr/share/man/man3/fopen.3.gz.

Note that while the /usr/share/man directory is the default location for manual pages, some Linux distributions may place them in other locations (such as /usr/local/share/man or /opt/man) for various reasons. However, these alternate locations are not compliant with the FHS.