man(1) man(1)

NAME man − format and display the on-line manual pages SYNOPSIS man [−acdfFhkKtwW][--path][−m system][−p string][−C config_file][−M pathlist][−P pager][−B browser][−H htmlpager][−S section_list][section] name ...

DESCRIPTION man formats and displays the on-line manual pages. If you specify section, man only looks in that section of the manual. name is normally the name of the manual page, which is typically the name of a , function, or file. However, if name contains a slash (/)then man interprets it as a file specification, so that you can do man ./foo.5 or even man //foo/bar.1.gz. See belowfor a description of where man looks for the manual page files.

MANUAL SECTIONS The standard sections of the manual include: 1 User Commands 2 System Calls 3 CLibrary Functions 4 Devices and Special Files 5 Formats and Conventions 6 Games et. Al. 7 Miscellanea 8 System Administration tools and Deamons Distributions customize the manual section to their specifics, which often include additional sections.

OPTIONS −C config_file Specify the configuration file to use; the default is @man_config_file@.(See man.conf(5).) −M path Specify the list of directories to search for man pages. Separate the directories with colons. An empty list is the same as not specifying −M all. See SEARCH PATHFOR MANUAL PA GES. −P pager Specify which pager to use. This option overrides the MANPAGER , which in turn overrides the PA GER variable. By default, man uses @pager@. −B Specify which browser to use on HTML files. This option overrides the BROWSER environment variable. By default, man uses @browser@, −H Specify a command that renders HTML files as text. This option overrides the HTMLPAGER environment variable. By default, man uses @htmlpager@, −S section_list List is a colon separated list of manual sections to search. This option overrides the MANSECT environment variable. −a By default, man will after displaying the first manual page it finds. Using this option forces man to display all the manual pages that match name, not just the first. −c Reformat the source , evenwhen an up-to-date page exists. This can be meaningful if the cat page was formatted for a screen with a different number of columns, or if the

September 19, 2005 1 man(1) man(1)

preformatted page is corrupted. −d Don’tactually display the man pages, but do print gobs of debugging information. −D Both display and print debugging info. −f Equivalent to whatis. −F or −−preformat Format only - do not display. −h Print a help message and exit. −k Equivalent to . −K Search for the specified string in *all* man pages. Warning: this is probably very slow! It helps to specify a section. (Just to give a rough idea, on my machine this takes about a minute per 500 man pages.) −m system Specify an alternate set of man pages to search based on the system name given. −p string Specify the sequence of preprocessors to run before nroff or troff.Not all installations will have a full set of preprocessors. Some of the preprocessors and the letters used to designate them are: eqn (e), grap (g), pic (p), tbl (t), vgrind (v), refer (r). This option overrides the MANROFFSEQ environment variable. −t Use @troff@ to format the manual page, passing the output to stdout. The default output format of @troff@ is Postscript, refer to the manual page of @troff@ for ways to pick an alternate for- mat. Depending on the selected format and the availability of printing devices, the output may need to be passed through some filter or another before being printed. −w or −−path Don’tactually display the man pages, but do print the location(s) of the files that would be format- ted or displayed. If no argument is given: display (on stdout) the list of directories that is searched by man for man pages. If manpath is a link to man, then "manpath" is equivalent to "man --path". −W Like−w, but print file names one per line, without additional information. This is useful in shell commands like man -aW man | -l

CATPAGES Man will try to save the formatted man pages, in order to save formatting the next time these pages are needed. Traditionally,formatted versions of pages in DIR/manX are savedinDIR/catX, but other map- pings from man dir to cat dir can be specified in @man_config_fi[email protected] pages are savedwhen the required cat directory does not exist. No cat pages are savedwhen theyare formatted for a line length dif- ferent from 80. No cat pages are savedwhen man.conf contains the line NOCACHE. It is possible to man suid to a user man. Then, if a cat directory has owner man and mode 0755 (only writable by man), and the cat files have owner man and mode 0644 or 0444 (only writable by man, or not writable at all), no ordinary user can change the cat pages or put other files in the cat directory.Ifman is not made suid, then a cat directory should have mode 0777 if all users should be able to leave cat pages there. The option −c forces reformatting a page, evenifarecent cat page exists.

HTML PAGES Man will find HTML pages if theyliv e in directories named as expected to be ".html", thus a valid name for an HTML version of the ls(1) man page would be /usr/share/man/htmlman1/ls.1.html.

September 19, 2005 2 man(1) man(1)

SEARCH PATHFOR MANUAL PAGES man uses a sophisticated method of finding manual page files, based on the invocation options and environ- ment variables, the @man_config_file@ configuration file, and some built in conventions and heuristics. First of all, when the name argument to man contains a slash (/), man assumes it is a file specification itself, and there is no searching involved. But in the normal case where name doesn’tcontain a slash, man searches a variety of directories for a file that could be a manual page for the topic named. If you specify the -M pathlist option, pathlist is a colon-separated list of the directories that man searches. If you don’tspecify -M butset the MANPATH environment variable, the value of that variable is the list of the directories that man searches. If you don’tspecify an explicit path list with -M or MANPATH, man develops its own path list based on the contents of the configuration file @man_config_fi[email protected] MANPATH statements in the configura- tion file identify particular directories to include in the search path. Furthermore, the MANPATH_MAP statements add to the search path depending on your command search path (i.e. your PATH environment variable). For each directory that may be in the command search path, a MANPATH_MAP statement specifies a directory that should be added to the search path for manual page files. man looks at the PATH variable and adds the corresponding directories to the manual page file search path. Thus, with the proper use of MANPATH_MAP,when you issue the command man xyz,you get a manual page for the program that would run if you issued the command xyz. In addition, for each directory in the command search path (we’ll call it a "command directory") for which you do not have a MANPATH_MAP statement, man automatically looks for a manual page directory "nearby" namely as a subdirectory in the command directory itself or in the parent directory of the com- mand directory. Youcan disable the automatic "nearby" searches by including a NOAUTOPATH statement in @man_con- fig_file@. In each directory in the search path as described above, man searches for a file named topic.section,with an optional suffix on the section number and possibly a compression suffix. If it doesn’tfind such a file, it then looks in anysubdirectories named manN or catN where N is the manual section number.Ifthe file is in a catN subdirectory, man assumes it is a formatted manual page file (cat page). Otherwise, man assumes it is unformatted. In either case, if the filename has a known compression suffix (like .gz), man assumes it is gzipped. If you want to see where (or if) man would find the manual page for a particular topic, use the --path (-w) option.

ENVIRONMENT MANPATH If MANPATH is set, man uses it as the path to search for manual page files. It overrides the con- figuration file and the automatic search path, but is overridden by the -M invocation option. See SEARCH PATHFOR MANUAL PAGES. MANPL If MANPL is set, its value is used as the display page length. Otherwise, the entire man page will occupyone (long) page. MANROFFSEQ If MANROFFSEQ is set, its value is used to determine the set of preprocessors run before run- ning nroff or troff.Bydefault, pages are passed through the tbl preprocessor before nroff. MANSECT If MANSECT is set, its value is used to determine which manual sections to search.

September 19, 2005 3 man(1) man(1)

MANWIDTH If MANWIDTH is set, its value is used as the width manpages should be displayed. Otherwise the pages may be displayed overthe whole width of your screen. MANPAGER If MANPAGER is set, its value is used as the name of the program to use to display the man page. If not, then PA GER is used. If that has no value either, @pager@ is used. BROWSER The name of a browser to use for displaying HTML manual pages. If it is not set, @browser@ is used. HTMLPAGER The command to use for rendering HTML manual pages as text. If it is not set, @htmlpager@ is used. LANG If LANG is set, its value defines the name of the subdirectory where man first looks for man pages. Thus, the command ‘LANG=dk man 1 foo’ will cause man to look for the foo man page in .../dk/man1/foo.1, and if it cannot find such a file, then in .../man1/foo.1, where ... is a directory on the search path. NLSPATH, LC_MESSAGES, LANG The environment variables NLSPATH and LC_MESSAGES (or LANG when the latter does not exist) play a role in locating the message catalog. (But the English messages are compiled in, and for English no catalog is required.) Note that programs like col(1) called by man also use e.g. LC_CTYPE. PATH PATH helps determine the search path for manual page files. See SEARCH PATHFOR MAN- UALPAGES. SYSTEM SYSTEM is used to get the default alternate system name (for use with the −m option). BUGS The −t option only works if a troff-likeprogram is installed. If you see blinking \255 or instead of hyphens, put ‘LESSCHARSET=latin1’ in your environment. TIPS If you add the line

(global-set-key [(f1)] (lambda () (interactive)(manual-entry (current-word))))

to your .emacs file, then hitting F1 will give you the man page for the library call at the current cursor posi- tion. To get a plain text version of a man page, without backspaces and underscores, try

#man foo | col -b > foo.mantxt AUTHOR John W.Eaton was the original author of man.ZeydM.Ben-Halim released man 1.2, and Andries Brouwer followed up with versions 1.3 thru 1.5p. Federico Lucifredi <fl[email protected]> is the current maintainer. SEE ALSO apropos(1), whatis(1), less(1), groff(1), man.conf(5).

September 19, 2005 4 whatis(1) whatis(1)

NAME whatis − search the whatis database for complete words. SYNOPSIS whatis keyword ... DESCRIPTION whatis searches a set of database files containing short descriptions of system commands for keywords and displays the result on the standard output. Only complete word matches are displayed.

The whatis database is created using the command @makewhatis@. AUTHOR John W.Eaton was the original author of man.ZeydM.Ben-Halim released man 1.2, and Andries Brouwer followed up with versions 1.3 thru 1.5p. Federico Lucifredi <fl[email protected]> is the current maintainer. SEE ALSO apropos(1), man(1).

September 19, 2005 1 apropos(1) apropos(1)

NAME apropos − search the whatis database for SYNOPSIS apropos keyword ... DESCRIPTION apropos searches a set of database files containing short descriptions of system commands for keywords and displays the result on the standard output. AUTHOR John W.Eaton was the original author of man.ZeydM.Ben-Halim released man 1.2, and Andries Brouwer followed up with versions 1.3 thru 1.5p. Federico Lucifredi <fl[email protected]> is the current maintainer. SEE ALSO whatis(1), man(1).

September 19, 2005 1 MAN.CONF(5) MAN.CONF(5)

NAME man.conf − configuration data for man DESCRIPTION This file is read by man(1) and contains (a) information on howtoconstruct the search path for man, (b) full path names for various programs likenroff, eqn, tbl etc. used by man, and (c) a list with uncompressors for files with a givenextension. An alternative version of this file can be specified with man -C private_man.conf ... The command names may be provided with options. Useful options to nroffcan be found in grotty(1). For example, instead of the default line NROFF /usr/bin/groff- -Tlatin1 one may NROFF /usr/bin/groff-mandoc -Tlatin1 -P-u -P-b in order to suppress underlining and overstriking. FILES @man_config_file@ AUTHOR John W.Eaton was the original author of man.ZeydM.Ben-Halim released man 1.2, and Andries Brouwer followed up with versions 1.3 thru 1.5p. Federico Lucifredi <fl[email protected]> is the current maintainer. SEE ALSO col(1), (g)eqn(1), (g)pic(1), groff(1), grotty(1), (g)refer(1), (g)tbl(1), less(1), man (1) and compress(1), gzip(1).

September 19, 2005 1 MAKEWHATIS(8) MAKEWHATIS(8)

NAME makewhatis − Create the whatis database SYNOPSIS makewhatis [-u] [-v] [-w] [-s sections ][-c [catpath]] [manpath] DESCRIPTION makewhatis reads all the manual pages contained in the given sections of manpath or the preformatted pages contained in the given sections of catpath.For each page, it writes a line in the whatis database; each line consists of the name of the page and a short description, separated by a dash. The description is extracted using the content of the NAME section of the manual page. Since other languages use a different term for the NAME section, makewhatis recognizes the equivalent terms in Czech, Italian, Finnish, French, German and Spanish. If no manpath argument is given, /usr/man is assumed by default. OPTIONS -u Update database with newpages. -v Verbose output -w Use manpath obtained from ‘man --path‘ -s sections Looks in the sections of manpath or catpath.Ifthe option is absent, the MANSECT envvar will be used. If it too is absent, the MANSECT setting in man.conf will be used. -c catpath The preformatted manual pages located in catpath are scanned. If the argument is not provided, it is assumed to be the first existing directory between /usr/man/preformat and /usr/man. EXAMPLES To rebuild only /usr/X11R6/man/whatis and /usr/local/man/whatis makewhatis /usr/X11R6/man /usr/local/man To rebuild all the databases, including those of the Finnish, French and Italian translations LANGUAGE=fi:fr:it makewhatis -w BUGS makewhatis may not handle too well manual pages written with non-standard troffmacros, such as the Tcl/Tk pages. makewhatis does not work on preformatted translations. AUTHOR John W.Eaton was the original author of man.ZeydM.Ben-Halim released man 1.2, and Andries Brouwer followed up with versions 1.3 thru 1.5p. Federico Lucifredi <fl[email protected]> is the current maintainer. SEE ALSO apropos(1), man(1), whatis(1)

September 19, 2005 1 man2html(1) man2html(1)

NAME man2html − format a manual page in html SYNOPSIS man2html [options] [file] DESCRIPTION man2html converts a manual page as found in file (or stdin, in case no file argument, or the argument "-", is given) from man-style nroffinto html, and prints the result on stdout. It does support tbl but does not know about eqn. The exit status is 0. If something goes wrong, an error page is printed on stdout.

This can be used as a stand-alone utility,but is mainly intended as an auxiliary,toenable users to browse their man pages using a html browser like lynx(1), xmosaic(1) or netscape(1).

The main part of man2html is the troff-to-html engine written by Richard Verhoeven([email protected].). It adds hyperlinks for the following constructs: ll.foo(3x) "http://localhost/cgi-bin/man/man2html?3x+foo" method://string "method://string" www.host.name "http://www.host.name" ftp.host.name "ftp://ftp.host.name" name@host "mailto:name@host" "file:/usr/include/string.h" (The first of these can be tuned by options - see below.)Nolookup is done - the links generated need not exist. Also an indexwith internal hyperlinks to the various sections is generated, so that it is easier to find one’sway in large man pages like bash(1).

OPTIONS When reading from stdin, it is not always clear howtodo.so expansion. The −D option allows a script to define the working directory.

−D pathname the last twoparts from the pathname, and do a chdir(dir)before starting the conversion. The −E option allows the easy generation of error messages from a cgi script.

−E string Output an error page containing the givenerror message. The general form of a hyperlink generated for a man page reference is with a default as shown above.The parts of this hyperlink are set using the various options. −h Set method:cgipath to http://localhost. This is the default. −H host[.domain][:port] Set method:cgipath to http://host.domain:port. −l Set method:cgipath to lynxcgi:/home/httpd. −L dir Set method:cgipath to lynxcgi:dir. −M man2htmlpath Set the man2htmlpath to use. The default is /cgi-bin/man/man2html. −p Set separator to ’/’. −q Set separator to ’?’. This is the default. −r Use relative html paths, instead of cgi-bin paths. On a machine without running httpd,one can use lynx to browse the man pages, using the lynxcgi method. When some http daemon is running, lynx, or anyother browser,can be used to browse the man pages, using the http method. The option −l (for ‘lynxcgi’) selects the former behaviour.With it, the default cgipath is /home/httpd.

1January 1998 1 man2html(1) man2html(1)

In general, a cgi script can be called by /? and the environment variables PATH_INFO and QUERY_STRING will be set to and , respectively.Since lynxcgi does not handle the PATH_INFO part, we generate hyperlinks with ‘?’ as a separator by default. The option −p (for ‘path’) selects ’/’ as a separator,while the option −q (for ‘query’) selects ’?’ as a separator.

The option −H host will specify the host to use (instead of localhost). A cgi script could use man2html -H $SERVER_NAME if the variable SERVER_NAME is set. This would allowyour machine to act as a server and export man pages.

BUGS There are manyheuristics. The output will not always be perfect. The lynxcgi method will not work if lynx was compiled without selecting support for it. There may be problems with security.

AUTHOR Richard Verhoevenwas the original author of man2html.Michael Hamilton and Andries Brouwer subse- quently improvedonit. Federico Lucifredi <fl[email protected]> is the current maintainer.

SEE ALSO lynx(1), man(1) #! /bin/sh # # Script to format manpages to dvi. #Copyright (c) 1997 Tobias Begalke ([email protected]) # # Part of release 1.6f of the man suite. #

groff="groff-Tdvi -mandoc"

if [ ! $# = 1 ]; then "$0: usage:" echo " $0 [topic] > topic.dvi" exit 1 fi

location=‘man -c -w $1‘

if [ "$location" = "" ]; then exit 1 fi

case ‘file $location‘ in *gzip* ) zcat $location | $groff ;;

*bzip2* ) bzcat $location | $groff ;;

*troff* ) $groff$location ;; esac

1January 1998 2