What is the MAN file format?
Files with the .man extension contain Unix user manuals written in roff source markup. Man pages can be accessed by issuing the man command followed by the name of a program, function, or topic. The source uses the *man* macro package - a set of dot-prefixed directives (.TH, .SH, .B, .TP) that man renders on demand via groff or mandoc. Opening a .man file in a text editor shows this raw markup rather than a formatted page; .man files support display formatting macros to control bold, italic, indentation, and table layout.
.man is a plain-text file and can be opened using any text editor, but user manuals are most commonly accessed using the system tool man invoked from the command line. Many graphical system environments offer various tools for viewing man documents. Man pages can be divided into the following sections:
- NAME - name of the program, tool, library, or function, followed by a short description
- SYNOPSIS - parameters and options for the command, and optionally a C function signature
- DESCRIPTION - detailed description of the command and its functions
- EXAMPLES - examples of how the command can be used
- SEE ALSO - a list of related functions or commands
Unix/Linux user manuals are not commonly saved as .man files on disk. Usually manuals are stored with a suffix indicating which section of the manual the file belongs to - for example ls.1 or printf.3 - and installed pages are typically gzip-compressed as name.section.gz, decompressed transparently by man. Man pages are typically in English, although some manuals are localized on various distributions.
Man documents are divided into numbered sections. The man command by default displays the first matching entry out of 7 sections (Unix System V) or 8 (Linux/BSD), which are:
- General commands
- System calls
- C library functions
- Special files and device drivers
- File formats and configuration files
- Games and screensavers
- Miscellaneous / overview pages
- System administration and daemons (Linux/BSD only)
Accessing a given section requires issuing man section_number name - for example, man 5 passwd. Manual output can be redirected to a different application for easier reading, for example to cat or less.
Security & safety
RISK: LOWA man-page source is plain text and does not execute on viewing. The only theoretical caution is that roff is a Turing-complete macro language and groff has historically had parsing bugs, so rendering a .man from a wholly untrusted source is best done with the safer, sandboxed mandoc rather than full groff. In normal use (reading docs from packages and projects) a .man file is harmless; opening it in a text editor is completely safe. Do not confuse it with a Windows .man mandatory profile, which is a registry hive, not a document.
Format details
in a nutshell- Windows 2000/XP mandatory user profile - Legacy Windows .man file is a read-only roaming user profile (a renamed NTUSER.DAT registry hive) - unrelated to Unix man pages; the db_name's original meaning.
- FoxPro / dBASE memory/menu file - Some old DOS database tools used .man for compiled menu or memo data; obsolete.
Programs that open MAN files
Technical details
deep spec| File encoding | ASCII or UTF-8 plain text; no binary content or byte-order mark required |
| MIME type | text/troff (primary); also recognized as application/x-troff-man or text/plain |
| Markup language | roff/troff using the man macro package (an-old macros); dot-prefixed macro calls must appear at the start of a line |
| Title macro | .TH (title header) - typically the first non-comment line; declares the page name, section number, date, and source package |
| Standard sections | NAME, SYNOPSIS, DESCRIPTION, OPTIONS, EXAMPLES, FILES, ENVIRONMENT, BUGS, SEE ALSO - each introduced by an .SH macro |
| Man-page section numbering | 7 sections on traditional Unix (System V); 8 on Linux and BSD - section 8 covers system administration commands |
| Typical file size | 1 KB - 100 KB; most pages fall between 5 KB and 30 KB |
| On-disk compression | Installed pages are commonly gzip-compressed (e.g. ls.1.gz) and decompressed transparently by man at read time |
| Rendering engine | groff (GNU troff) on Linux; mandoc on BSD and modern macOS, which replaced groff as the default man renderer |
| Common file naming | Section-number extension is standard on disk (ls.1, printf.3, passwd.5); the .man extension is used mainly by third-party or bundled documentation |
| Installation path | /usr/share/man/manN/ on Linux and BSD, where N is the section number; macOS uses /usr/share/man/ with the same directory layout |
| Output formats | Terminal text via a pager (less), PostScript, PDF, HTML, and plain text - all produced on demand by groff -T |
| Related source formats | mdoc (BSD alternative macro set), pod2man (Perl POD to man), Sphinx man builder, and ronn (Markdown-to-man converter) |
| Developer / origin | Bell Labs (original Unix man system, 1971); man macros and groff maintained by the GNU Project |
| Released | 1971 (Unix Programmer's Manual, V1); man macros standardized through the 1970s-80s |
| Latest version | N/A (roff/man-macro convention; groff is the active implementation) |
| Open standard | Yes · royalty-free |
| Specification | man7.org |
MAN conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about MAN files.