On Linux and other Unix-like operating systems, man is the interface used to view the system’s reference manuals.
Description
man is the system’s manual viewer; it can be used to display manual pages, scroll up and down, search for occurrences of specific text, and other useful functions.
- Description
- Syntax
- Section numbers
- Exit status
- Environment
- Files
- Examples
- Related commands
- Linux commands help
Each argument given to man is normally the name of a program, utility or function. The manual page associated with each of these arguments is then found and displayed. A section number, if provided, will direct man to look only in that section of the manual. The default action is to search in all of the available sections, following a pre-defined order and to show only the first page found, even if page exists in several sections.
Syntax
man [-C file] [-d] [-D] [–warnings[=warnings]] [-R encoding] [-L locale] [-m system[,…]] [-M path] [-S list] [-e extension] [-i|-I] [–regex|–wildcard] [–names-only] [-a] [-u] [–no-subpages] [-P pager] [-r prompt] [-7] [-E encoding] [–no-hyphenation] [–no-justification] [-p string] [-t] [-T[device]] [-H[browser]] [-X[dpi]] [-Z] [[section] page …] …
man -k [apropos options] regexp …
man -K [-w|-W] [-S list] [-i|-I] [–regex] [section] term …
man -f [whatis options] page …
man -l [-C file] [-d] [-D] [–warnings[=warnings]] [-R encoding] [-L locale] [-P pager] [-r prompt] [-7] [-E encoding] [-p string] [-t] [-T[device]] [-H[browser]] [-X[dpi]] [-Z] file …
man -w|-W [-C file] [-d] [-D] page …
man -c [-C file] [-d] [-D] page …
man [-hV]
General options
Options: Main modes of operation
Options: finding manual pages
Options: Controlling formatted output
Section numbers
The section numbers of the manual are listed below. While reading documentation, if you see a command name followed by a number in parentheses, the number refers to one of these sections. For example, man is the documentation of man found in section number 1. Some commands may have documentation in more than one section, so the numbers after the command name may direct you to the correct section to find a specific type of information.
man -aw git diff
/usr/share/man/man1/git-diff.1.gz
man -aw –no-subpages git diff
/usr/share/man/man1/git.1.gz /usr/share/man/man3/Git.3pm.gz /usr/share/man/man1/diff.1.gz
Manual page name(sec) line x
\ Manual\ page\ $MAN_PN\ ?ltline\ %lt?L/%L.:byte\ %bB?s/%s..?\ (END):?pB\ %pB\%..(press h for help or q to quit)
The section numbers, and the topics they cover, are as follows:
Exit status
When it terminates, man will return one of the following exit status:
Environment
man makes use of the following environment variables:
Files
The following files are used by man:
Examples
man man
View the manual page for the man command.
man –nh –nj man
View the manual page for man, with no hyphenated words or justified lines.
Related commands
apropos — Search the manual pages for a keyword or regular expression.info — Read Info documents.whatis — Display short manual page descriptions.