MAN(1)
π MAN(1) β the manual page manual, bestie π
General Commands Manual β¨ so like, this is man from the General Commands Manual, and yes we're reading the manual about the manual, it's giving inception, it's giving iconic π
πΈ NAME πΈ
man β display manual pages πβ¨
π¦ SYNOPSIS π¦
man [-acfhklw] [-C file] [-M path] [-m path] [-S subsection]
[[-s] section] name ...
π DESCRIPTION π
Okay so the man utility displays the manual page entitled name. Periodt. π
Pages can be picked out by a specific category (section) or by machine architecture (subsection), because variety is the spice of life.
The options are as follows, and bestie, we are going through all of them:
-aβ Display all matching manual pages. Not just the first one, all of them. greedy queen π-Cfile β Use the specified file instead of the default configuration file. This lets users configure their own manual environment. Seeman.conf(5)for a description of what goes in this file.-cβ Copy the manual page to the standard output instead of usingless(1)to paginate it. This is done by default if the standard output is not a terminal device.
When using-c, most terminal devices are unable to show the markup. To print the output ofmanto the terminal with markup but without using a pager, pipe it toul(1). To remove the markup, pipe the output tocol(1) -binstead. π«Ά
-fβ A synonym forwhatis(1). It searches for name in manual page names and displays the header lines from all matching pages. The search is case insensitive and matches whole words only. no partial credit, whole words or nothing fr fr π-hβ Display only the SYNOPSIS lines of the requested manual pages. Implies-aand-c. just the tldr bestie β¨-kβ A synonym forapropos(1). Instead of name, an expression can be provided using the syntax described in theapropos(1)manual. By default, it displays the header lines of all matching pages.-lβ A synonym formandoc(1). The name arguments are interpreted as filenames. No search is done and file, path, section, subsection, and-ware ignored. This option implies-a. ignored means IGNORED, don't come for me π-Mpath β Override the list of directories to search for manual pages. The supplied path must be a colon (:) separated list of directories. This option also overrides the environment variableMANPATHand any directories specified in theman.conf(5)file. full override energy π₯-mpath β Augment the list of directories to search for manual pages. The supplied path must be a colon (:) separated list of directories. These directories will be searched before those specified using the-Moption, theMANPATHenvironment variable, theman.conf(5)file, or the default directories. it's the plus-one, it goes first π-Ssubsection β Only show pages for the specifiedmachine(1)architecture. subsection is case insensitive.
By default manual pages for all architectures are installed. Therefore this option can be used to view pages for one architecture whilst using another.
This option overrides the MACHINE environment variable.
[-s]section β Only select manuals from the specified section. The currently available sections are:- General commands (tools and utilities).
- System calls and error numbers.
- Library functions. 3p.
perl(1)programmer's reference guide. - Device drivers.
- File formats.
- Games.
- Miscellaneous information.
- System maintenance and operation commands.
- Kernel internals.
-wβ List the pathnames of all matching manual pages instead of displaying any of them. If no name is given, list the directories that would be searched. just the receipts, no content π§Ύ
The options -IKOTW are also supported and are documented in mandoc(1). The options -fkl are mutually exclusive and override each other. pick ONE bestie, they fight π
π how the search actually goes down π
The search starts with the -m argument if provided, then continues with the -M argument, the MANPATH variable, the manpath entries in the man.conf(5) file, or with /usr/share/man:/usr/X11R6/man:/usr/local/man by default. Within each of these, directories are searched in the order provided. Within each directory, the search proceeds according to the following list of sections: 1, 8, 6, 2, 3, 5, 7, 4, 9, 3p. The first match found is shown. first come first served, no queue-jumping π
The mandoc.db(5) database is used for looking up manual page entries. In cases where the database is absent, outdated, or corrupt, man falls back to looking for files called name.section. If both a formatted and an unformatted version of the same manual page, for example cat1/foo.0 and man1/foo.1, exist in the same directory, only the unformatted version is used. The database is kept up to date with makewhatis(8), which is run by the weekly(8) maintenance script. π
Guidelines for writing man pages can be found in mdoc(7). go off, write your own βοΈ
π ENVIRONMENT π
MACHINEβ As some manual pages are intended only for specific architectures,mansearches any subdirectories, with the same name as the current architecture, in every directory which it searches. Machine specific areas are checked before general areas. The current machine type may be overridden by setting the environment variableMACHINEto the name of a specific architecture, or with the-Soption.MACHINEis case insensitive.MANPAGERβ Any non-empty value of the environment variableMANPAGERis used instead of the standard pagination program,less(1). Ifless(1)is used, the interactive:tcommand can be used to go to the definitions of various terms, for example command line options, command modifiers, internal commands, environment variables, function names, preprocessor macros,errno(2)values, and some other emphasized words. Some terms may have defining text at more than one place. In that case, theless(1)interactive commandstandTcan be used to move to the next and to the previous place providing information about the term last searched for with:t. The-O tag[=term]option documented in themandoc(1)manual opens a manual page at the definition of a specific term rather than at the beginning. tag navigation is the main character of this paragraph, lowkey πMANPATHβ Override the standard search path which is either specified inman.conf(5)or the default path. The format ofMANPATHis a colon (:) separated list of directories. Invalid directories are ignored. Overridden by-M, ignored if-lis specified.
If MANPATH begins with a colon, it is appended to the standard path; if it ends with a colon, it is prepended to the standard path; or if it contains two adjacent colons, the standard path is inserted between the colons. colons are doing SO much heavy lifting here π
PAGERβ Specifies the pagination program to use whenMANPAGERis not defined. If neitherPAGERnorMANPAGERis defined,less(1)is used.
π FILES π
/etc/man.confβ default man configuration file
π EXIT STATUS π
The man utility exits 0 on success, and >0 if an error occurs. See mandoc(1) for details. zero is the vibe, anything else is a vibe check failure π
β¨ EXAMPLES β¨
Format a page for pasting extracts into an email message β avoid printing any UTF-8 characters, reduce the width to ease quoting in replies, and remove markup:
$ man -T ascii -O width=65 pledge | col -b
Read a typeset page in a PDF viewer:
$ MANPAGER=mupdf man -T pdf lpd
π¦ SEE ALSO π¦
apropos(1), col(1), mandoc(1), ul(1), whereis(1), man.conf(5), mdoc(7)
π STANDARDS π
The man utility is compliant with the IEEE Std 1003.1-2008 (βPOSIX.1β) specification. πβ¨
The flags [-aCcfhIKlMmOSsTWw], as well as the environment variables MACHINE, MANPAGER, and MANPATH, are extensions to that specification.
π§ HISTORY π§
A man command first appeared in Version 2 AT&T UNIX. ancient. iconic. the blueprint ποΈ
The -w option first appeared in Version 7 AT&T UNIX; -f and -k in 4BSD; -M in 4.3BSD; -a in 4.3BSD-Tahoe; -c and -m in 4.3BSD-Reno; -h in 4.3BSD Net/2; -C in NetBSD 1.0; -s and -S in OpenBSD 2.3; and -I, -K, -l, -O, and -W in OpenBSD 5.7. The -T option first appeared in AT&T System III UNIX and was also added in OpenBSD 5.7. a whole timeline of glow-ups π₯
Debian π July 20, 2020 π that's the source and the date bestie, and this has been MAN(1), ty for coming to my ted talk, ily, go read a man page πβ¨π«Ά
π¦ where this page comes from
- debian trixie: mandoc 1.14.6-4 Β· ISC
- ubuntu questing: mandoc 1.14.6-4
- ubuntu resolute: mandoc 1.14.6-4build1 Β· ISC
- ubuntu stonking: mandoc 1.14.6-4build1 Β· ISC
- Copyright (c) 1989, 1990, 1993 The Regents of the University of California. All rights reserved
- Copyright (c) 2003, 2007, 2008, 2014 Jason McIntyre <jmc@openbsd.org>
- Copyright (c) 2010, 2011, 2014-2020 Ingo Schwarze <schwarze@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms