aspose.info
EN

MAN - Your Guide to Unix Manual Pages

Updated

What is a MAN file?

A .man file is a Unix manual page, serving as a vital piece of software documentation directly within the operating system. This format is the foundation of the built-in man utility, a powerful command-line tool that allows users to instantly access comprehensive programming and user manuals. To view this documentation, you simply use the terminal to issue commands, which retrieves information organized into structured sections and pages. A key advantage of this system is its complete offline accessibility; as a soft copy resident on the computer, it eliminates the need for a printed manual or an active internet connection, providing immediate help right at your fingertips. This makes the .MAN file an indispensable, always-available resource for developers and system administrators.

Unix Manual Man File Format - More Information

Man pages are stored in plain text format and can be created and opened in any text editor for viewing or editing. In UNIX, information from the Man pages is retrieved by issuing commands from terminal that includes reference to section and page numbers from the manual.

Sections and Pages

Unix man is the system’s manual where each page argument to the command refers to the name of a program, utility or function. the command, if provided with section information, will search for the page in that specific section. However, the default behaviour is to search for the page in all sections and display the first page irrespective of if it exists in multiple sections.

Section Numbers

Following is the information about the section numbers of the manual followed by the types of pages they contain.

Section NumberType of pages
1Executable programs or shell commands
2System calls (functions provided by the kernel)
3Library calls (functions within program libraries)
4Special files (usually found in /dev)
5File formats and conventions, e.g. /etc/passwd
6Games
7Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
8System administration commands (usually only for root)
9Kernel routines [Non standard]

Example - How to Read MAN Pages?

Here is an example how to retrieve informatino about MkDir command using the Man command.

% man mkdir

MKDIR(1)    USER COMMANDS       MKDIR(1)

NAME
   mkdir - make a directory

SYNOPSIS
   mkdir [ -p ] dirname...

DESCRIPTION
   mkdir creates directories. Standard entries,`.',for the
   directory itself, and `..' for its parent, are made automat-
   ically.

   The -p flag allows missing parent directories
   to be created as needed.

   With the exception of the set-gid bit, the
   current umask(2V) setting determines the mode in which
   directories are created. The new directory inherits the set-gid
   bit of the parent directory. Modes may be modified after
   creation by using chmod(1V).

   mkdir requires write permission in the parent directory.

SEE ALSO
   chmod(1V), rm(1), mkdir(2v), umask(2V)

Key Characteristics of the MAN File Format

CharacteristicDescription
File Extension.man, .gz (as they are often compressed), or no extension at all.
Format TypePlain text with groff/troff markup.
Primary FunctionTo provide standardized, offline documentation for software and system components in Unix-like environments.
Associated ProgramsThe man command (the primary viewer), groff (the formatter), and text editors (for creation/modification).
Output FormatVarious software applications, from compilers and media players to custom in-house tools.
ProsFast, consistent, always available offline, universally supported on Unix-like systems, and highly structured.
ConsCan be technical and dense for beginners; the markup language has a learning curve for contributors.

FAQ

Q1: How do I open a MAN file in Windows?

A: MAN files are native to Unix; to view them on Windows, you need a compatibility layer like Cygwin or WSL (Windows Subsystem for Linux).

Q2: What is the difference between MAN and INFO files?

A: Both provide documentation, but info pages, from the GNU project, are often more detailed and hyperlinked, while man pages are designed for quick, concise reference.

Q3: Can I create my own MAN page?

A: Yes, you can write a text file using the groff markup language and install it in a directory listed in your MANPATH environment variable.

Q4: What does the number in ‘man(1)’ mean?

A: The number indicates the manual section; man(1) refers to the man command itself in section 1 (user commands), while man(7) would refer to the macro package used to format man pages.

Q5: Why does ‘man man’ show the manual for the man command?

A: The first man is the command, and the second is the argument; running man man displays the manual page that documents how the man command itself works.

References

See also