Scroll to navigation

MAN(1) マニュアルページユーティリティー MAN(1)

名前

man - an interface to the system reference manuals

書式

man [man options] [[section] page ...] ...
man -k [apropos options] regexp ...
man -K [man options] [section] term ...
man -f [whatis options] page ...
man -l [man options] file ...
man -w|-W [man options] page ...

説明

man is the system's manual pager. Each page 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, 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 (see DEFAULTS), and to show only the first page found, even if page exists in several sections.

次の表はマニュアルの section 番号およびその section に含まれるページの種類を示します。

1 実行プログラムまたはシェルコマンド
2 システムコール (カーネルが提供する関数)
3 ライブラリー呼び出し (プログラムライブラリーに含まれる関数)
4 Special files (usually found in /dev)
5 File formats and conventions, e.g. /etc/passwd
6 ゲーム
7 Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7)
8 システム管理コマンド (通常は root 用)
9 カーネルルーチン [非標準]

マニュアルページ page は複数の節で構成されます。

慣習として、 説明 (NAME)書式 (SYNOPSIS)設定 (CONFIGURATION)説明 (DESCRIPTION)オプション (OPTIONS)終了ステータス (EXIT STATUS)戻り値 (RETURN VALUE)エラー (ERRORS)環境変数 (ENVIRONMENT)ファイル (FILES)バージョン (VERSIONS)準拠 (CONFORMING TO)備考 (NOTES)バグ (BUGS) (EXAMPLE)著者 (AUTHORS)、および 関連項目 (SEE ALSO)という名前の節が含まれます。

書式 の節では次の表記が使用されます。他の節でも同様にすることを推奨します。

太字 (bold) 表示されている通りに入力します。
イタリック体・斜体(italic) 適切な引数に置換します。
[-abc] [ ] 内の引数はオプションです。
-a|-b | で区切られたオプションは同時に指定できません。
argument ... argument は繰り返し指定できます。
[expression] ... [ ] 内の expression 全体は繰り返し指定できます。

厳密な印字は出力デバイスに依存して変わります。例えば、端末内で man を実行した時はイタリック体が使用出来ないため、下線または色が付けられたテキストを代わりに使用します。

コマンドまたは関数の書式はすべての利用可能なパターンを網羅しているべきです。排他的な起動方法に関しては、このマニュアルページの 書式 節のように、分けて表示することを推奨します。

項目 (プログラム) ls のマニュアルページを表示します。
Display the manual page for macro package man from section 7. (This is an alternative spelling of "man 7 man".)
Display the manual page for macro package man from section 7. (This is another alternative spelling of "man 7 man". It may be more convenient when copying and pasting cross-references to manual pages. Note that the parentheses must normally be quoted to protect them from the shell.)
マニュアル内に含まれるすべての利用可能な intro マニュアルページを連続して表示します。連続表示の途中でやめたり、スキップすることもできます。
Format the manual page for bash into the default troff or groff format and pipe it to the printer named ps. The default output for groff is usually PostScript. man --help should advise as to which processor is bound to the -t option.
This command will decompress and format the nroff source manual page ./foo.1x.gz into a device independent (dvi) file. The redirection is necessary as the -T flag causes output to be directed to stdout with no pager. The output could be viewed with a program such as xdvi or further processed into PostScript using a program such as dvips.
キーワード printf をマニュアルページ名と要約文の中から正規表現として検索します。一致するすべてのマニュアルページが表示されます。 apropos printf と同様です。
smail によって参照されるマニュアルページを検索し、見つかったページの要約を表示します。 whatis smail と同様です。

概要

利用者が可能な限り柔軟に利用できるようにするため、 man には多数のオプションがあります。検索パス、セクションの順番、出力処理系、および他の動作を変更することができます。操作方法については次で説明します。

If set, various environment variables are interrogated to determine the operation of man. It is possible to set the "catch-all" variable $MANOPT to any string in command line format, with the exception that any spaces used as part of an option's argument must be escaped (preceded by a backslash). man will parse $MANOPT prior to parsing its own command line. Those options requiring an argument will be overridden by the same options found on the command line. To reset all of the options set in $MANOPT, -D can be specified as the initial command line option. This will allow man to "forget" about the options specified in $MANOPT, although they must still have been valid.

Manual pages are normally stored in nroff(1) format under a directory such as /usr/share/man. In some installations, there may also be preformatted cat pages to improve performance. See manpath(5) for details of where these files are stored.

This package supports manual pages in multiple languages, controlled by your locale. If your system did not set this up for you automatically, then you may need to set $LC_MESSAGES, $LANG, or another system-dependent environment variable to indicate your preferred locale, usually specified in the POSIX format:

<language>[_<territory>[.<character-set>[,<version>]]]

設定しているロケールで目的のページが利用可能な場合は、標準 (通常はアメリカ英語) ページの代わりに表示されます。

If you find that the translations supplied with this package are not available in your native language and you would like to supply them, please contact the maintainer who will be coordinating such activity.

Individual manual pages are normally written and maintained by the maintainers of the program, function, or other topic that they document, and are not included with this package. If you find that a manual page is missing or inadequate, please report that to the maintainers of the package in question.

このマニュアルページャーで利用可能な機能および拡張の情報に関しては、パッケージで提供されている文書を参照してください。

デフォルトの値と動作

The order of sections to search may be overridden by the environment variable $MANSECT or by the SECTION directive in /etc/manpath.config. By default it is as follows:

1 n l 8 3 2 3posix 3pm 3perl 3am 5 4 9 6 7

The formatted manual page is displayed using a pager. This can be specified in a number of ways, or else will fall back to a default (see option -P for details).

The filters are deciphered by a number of means. Firstly, the command line option -p or the environment variable $MANROFFSEQ is interrogated. If -p was not used and the environment variable was not set, the initial line of the nroff file is parsed for a preprocessor string. To contain a valid preprocessor string, the first line must resemble

'\" <string>

string は後で説明しているオプション -p の文字の組み合わせです。

フィルター情報としてこれらの方法のいずれも使用されていない場合、デフォルト値が使用されます。

整形パイプラインはフィルターとメインの整形ツール (nroff 、または [tg]roff-t オプションを指定したもの) で構成され、実行されます。他のものとしてマニュアルページ階層のルートに実行ファイル mandb_nfmt (または mandb_tfmt) が存在した場合、mandb_nfmt (または mandb_tfmt-t オプション指定で) 実行されます。これには、マニュアルのソースファイル、前処理文字列およびオプションのデバイス指定が -T または -E と併せて引数として渡されます。

オプション

Non-argument options that are duplicated either on the command line, in $MANOPT, or both, are not harmful. For options that require an argument, each duplication will override the previous argument value.

一般的なオプション

デフォルトの ~/.manpath ではなく指定したユーザ設定ファイルを使用します。
デバッグ情報を表示します。
通常はこのオプションを一番最初に指定し、 man の動作をデフォルトにリセットします。これを使用すると、 $MANOPT で設定されているオプションをリセットできます。 -D の後に続くオプションは通常通りの効果があります。
groff からの警告を有効にします。このオプションはマニュアルページのソーステキストの整合性検査を行うために使用されます。 warnings はコンマ区切りの警告名のリストです。指定されていない場合はデフォルト値として "mac" が使用されます。使用可能な警告名に関しては info groff の “Warnings” ノードを参照してください。

操作のメインモード

Equivalent to whatis. Display a short description from the manual page, if available. See whatis(1) for details.
apropos と同様です。キーワード (keywords) に一致するマニュアルページの短い要約文を検索し、それを表示します。詳細は apropos(1) を参照してください。
すべてのマニュアルページのテキストを検索します。全数検索を行うため、長い時間がかかります。検索するページ数を減らすために、可能であればセクションを指定するべきです。検索する語はデフォルトでは単純な文字列です。 --regex オプションを指定した場合は正規表現になります。
Note that this searches the sources of the manual pages, not the rendered text, and so may include false positives due to things like comments in source files. Searching the rendered text would be much slower.
Activate "local" mode. Format and display local manual files instead of searching through the system's manual collection. Each manual page argument will be interpreted as an nroff source file in the correct format. No cat file is produced. If '-' is listed as one of the arguments, input will be taken from stdin. When this option is not used, and man fails to find the page required, before displaying the error message, it attempts to act as if this option was supplied, using the name as a filename and looking for an exact match.
Don't actually display the manual page, but do print the location of the source nroff file that would be formatted. If the -a option is also used, then print the locations of all source files that match the search criteria.
Don't actually display the manual page, but do print the location of the preformatted cat file that would be displayed. If the -a option is also used, then print the locations of all preformatted cat files that match the search criteria.
If -w and -W are both used, then print both source file and cat file separated by a space. If all of -w, -W, and -a are used, then do this for each possible match.
このオプションは一般的には使用しません。 catman プログラムのみが使用します。
マニュアルページを通常の方法で整形する代わりに、 encoding で指定したエンコーディングに変換して出力します。ソースファイルのエンコーディングを知っている場合は、 manconv(1) を直接使用することもできます。しかしながら、このオプションにより、マニュアルページ階層と同様の構造でインストールされた形で提供されている、複数のマニュアルページのエンコーディングを明示的に意識することなく単一のエンコーディングに変換して出力できます。
Consider using man-recode(1) instead for converting multiple manual pages, since it has an interface designed for bulk conversion and so can be much faster.

マニュアルページの検索方法

man は通常、現在のロケールを C の関数 setlocale(3) を呼び出すことによって決定します。これはおそらく $LC_MESSAGES や $LANG などを含むさまざまな環境変数を使用します。一時的にこの値を上書きしたい場合には、このオプションを使用して man に直接 locale 文字列を渡します。これはページの検索が実際に開始されるまでは効果が無いことに注意してください。ヘルプメッセージなどは常に初期に決定されたロケールによって表示されます。
システム上で他のシステムのマニュアルページにアクセス可能な場合、このオプションを指定してアクセスします。 NewOS のマニュアルページを参照する場合はオプション -m NewOS を使用します。

system はコンマ区切りのオペレーティングシステム名で指定します。現在使用しているオペレーティングシステムのマニュアルページを含める場合には、システム名の引数に man を含めます。このオプションは $SYSTEM 環境変数を上書きします。

代替のマニュアルページ検索パスを指定します。デフォルトでは manmanpath で取得できるコードを使用してから検索するパスを決定します。このオプションは $MANPATH 環境変数を上書きし、 -m オプションは無視されます。

A path specified as a manpath must be the root of a manual page hierarchy structured into sections as described in the man-db manual (under "The manual page system"). To view manual pages outside such hierarchies, see the -l option.

The given list is a colon- or comma-separated list of sections, used to determine which manual sections to search and in what order. This option overrides the $MANSECT environment variable. (The -s spelling is for compatibility with System V.)
Some systems incorporate large packages of manual pages, such as those that accompany the Tcl package, into the main manual page hierarchy. To get around the problem of having two manual pages with the same name such as exit(3), the Tcl pages were usually all assigned to section l. As this is unfortunate, it is now possible to put the pages in the correct section, and to assign a specific "extension" to them, in this case, exit(3tcl). Under normal operation, man will display exit(3) in preference to exit(3tcl). To negotiate this situation and to avoid having to know which section the page you require resides in, it is now possible to give man a sub-extension string indicating which package the page must belong to. Using the above example, supplying the option -e tcl to man will restrict the search to pages having an extension of *tcl.
マニュアルページを検索する時に大文字と小文字の区別をしません。これはデフォルトの動作です。
マニュアルページを検索する時に大文字と小文字を区別します。
Show all pages with any part of either their names or their descriptions matching each page argument as a regular expression, as with apropos(1). Since there is usually no reasonable way to pick a "best" page when searching for a regular expression, this option implies -a.
Show all pages with any part of either their names or their descriptions matching each page argument using shell-style wildcards, as with apropos(1) --wildcard. The page argument must match the entire name or description, or match on word boundaries in the description. Since there is usually no reasonable way to pick a "best" page when searching for a wildcard, this option implies -a.
--regex または --wildcard オプションと併せて使用した場合、一致処理を要約文に対して行わず、ページ名のみに一致処理を行います。 whatis(1) で使用した時も同様です。その他の場合は何も効果を及ぼしません。
デフォルトでは、 man は最適なマニュアルページを表示した後に終了します。このオプションを使用すると、検索条件に一致したすべてのマニュアルページを順番に表示します。
This option causes man to update its database caches of installed manual pages. This is only needed in rare situations, and it is normally better to run mandb(8) instead.
By default, man will try to interpret pairs of manual page names given on the command line as equivalent to a single manual page name containing a hyphen or an underscore. This supports the common pattern of programs that implement a number of subcommands, allowing them to provide manual pages for each that can be accessed using similar syntax as would be used to invoke the subcommands themselves. For example:

  $ man -aw git diff
  /usr/share/man/man1/git-diff.1.gz

To disable this behaviour, use the --no-subpages option.

  $ 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

整形済み出力の制御

Specify which output pager to use. By default, man uses pager, falling back to cat if pager is not found or is not executable. This option overrides the $MANPAGER environment variable, which in turn overrides the $PAGER environment variable. It is not used in conjunction with -f or -k.

この値は、単純なコマンド名か引数付きのコマンドで、シェルのエスケープ文字 (バックスラッシュ、シングルクォート、ダブルクォート) を使用している場合があります。パイプを使用して複数のコマンドをつなげることはできません。そのような必要性がある場合、表示するファイルを、単一の引数または標準入力として受け取るラッパースクリプトを使用します。

less の最近のバージョンをページャーと指定使用している場合、 man はプロンプトに有意義な情報を表示するための設定をします。デフォルトのプロンプトは次の通りです。

Manual page name(sec) line x

name はマニュアルページの名前です。 sec はマニュアルページが見つかったセクション名です。そして x は現在の行番号です。これは $LESS 環境変数を使用して行われています。

Supplying -r with a string will override this default. The string may contain the text $MAN_PN which will be expanded to the name of the current manual page and its section name surrounded by "(" and ")". The string used to produce the default could be expressed as

\ Manual\ page\ \$MAN_PN\ ?ltline\ %lt?L/%L.:
byte\ %bB?s/%s..?\ (END):?pB\ %pB\\%..
(press h for help or q to quit)

ここでは読みやすさを考慮して3行に分割しています。実際の意味については less(1) のマニュアルページを参照してください。プロンプトの文字列は最初にシェルによって解釈されます。プロンプト内のすべてのダブルクォート、バッククォート、およびバックスラッシュは前にバックスラッシュを配置してエスケープしなければいけません。プロンプト文字列はエスケープされた $ で終了し、その後に less 用のオプションが続いている場合があります。デフォルトでは、 man-ix8 オプションを設定します。

The $MANLESS environment variable described below may be used to set a default prompt string if none is supplied on the command line.

-7, --ascii
純粋な ascii(7) マニュアルページを、 7 ビット端末または端末エミュレーターで参照する場合、 latin1(7) デバイス設定と GNU nroff を併せて使用した時に、いくつかの文字は正しく表示されません。このオプションを使用すると、純粋な ascii マニュアルページを表示時に latin1 デバイス設定を使用して ascii で表示することができます。これは latin1 テキストは全く変換しません。次の表は実行される変換を表します。これらのうちのいくつかは GNU nrofflatin1(7) デバイス設定を使用した場合にのみ正しく表示されます。

説明 八進数 latin1 ascii
continuation hyphen 255 -
bullet (中点) 267 o
acute アクセント 264 ´ '
乗算記号 327 × x

latin1 列が正しく表示される場合は、端末は latin1 文字を扱えるように設定されているためこのオプションは不要です。 latin1 列と ascii 列が同一の場合、このオプションを使用してこのページを見ているか、 manlatin1 デバイス設定を使用していません。 latin1 列が欠けているか表示がおかしい場合、マニュアルページを参照する時にこのオプションを使用する必要があります。

-t-H-T、 または -Z オプションを使用している場合、および GNU groff 以外を使用している場合は意味がありません。

デフォルト以外の文字エンコーディングで出力を生成します。過去の互換性のために、 encoding には、UTF-8 のような実際のエンコーディングに加えて asciilatin1、または utf8 のような nroff デバイス設定も使用できます。
通常、 nroff は、単語内にハイフンが無かったとしても、改行部分でテキストに自動的にハイフンを付加します。これにより、行内の単語間に過剰なスペースが配置されることを防ぎます。このオプションは自動的なハイフン付加を無効にします。よって、ハイフンが含まれている単語のみハイフン区切りが行われます。

マニュアルページを書いていて、 nroff が単語内の誤った場所にハイフンを付加するのを防止したい場合、このオプションを使用しないでください。代わりに nroff の文書を参照してください。例えば、 "\%" を単語内に含めると、その場所にハイフンを付加することが可能であることを示します。また、 "\%" を単語の最初に付加すると、その単語にはハイフンは付加されません。

通常、 nroff は自動的に左右余白に対してテキストを均等割り付けします。このオプションは左右余白の均等割り付けを抑止し、左側余白のみ整列します。これは "ragged-right" text と呼ばれます。

マニュアルページを書いていて、 nroff がある段落に対して均等割り付けを行うのを防止したい場合、このオプションを使用しないでください。代わりに nroff の文書を参照してください。例えば ".na" 、 ".nf" 、 ".fi" 、 および ".ad" を使用すると一時的に字間調整や字詰めを無効にするように要求できます。

nroff または troff/groff の前に実行する前処理系の順序を指定します。必ずしもすべてのインストールされたシステムで完全な前処理系集合が使用できるわけではありません。いくつかの前処理系とそれを使用して整形する文字の例は eqn (e)、 grap (g)、 pic (p)、 tbl (t)、 vgrind (v)、 refer (r) です。このオプションは $MANROFFSEQ 環境変数を上書きします。 zsoelim は常に最初の前処理系として使用されます。
groff -mandoc を使用してマニュアルページを整形し、標準出力へ出力します。このオプションは -H-T、または -Z オプションと併せて使用する必要はありません。
このオプションは groff (または troff) の出力をデフォルト以外の適切なデバイス設定に変更するために使用します。暗黙的に -t が指定されます。 例は (groff-1.17 を使用した時) dvilatin1psutf8X75 および X100 です。
このオプションを指定した場合、 groff は HTML 出力を生成し、その出力をウェブブラウザーで表示します。ブラウザーはオプション引数の browser (指定されている場合)、 $BROWSER 環境変数が使用されます。それらが設定されていない場合はコンパイル時のデフォルト (通常は lynx) が使用されます。このオプションにより暗黙的に -t が指定されます。そして、 GNU troff を使用している時のみ有効です。
このオプションを指定した場合、 gxditview プログラムを使用して、groff の出力をグラフィカルウィンドウに表示します。 dpi (ドット/インチ) は 75、 75-12、 100、 または 100-12 であり、デフォルトは 75 です。 -12 では 12 ポイントのフォントを使用します。このオプションにより -T オプションと、その引数としてそれぞれ X75、 X75-12、 X100、または X100-12 デバイス設定が暗黙的に指定されます。
grofftroff を実行した後、適切な後処理系を使用して、選択したデバイス設定に適した出力を生成します。 groff -mandocgroff の場合、このオプションは groff に渡され、後処理系の使用が抑止されます。このオプションにより -t が暗黙的に指定されます。

ヘルプの取得

-?, --help
ヘルプメッセージを表示して終了します。
Print a short usage message and exit.
バージョン情報を表示します。

終了ステータス

0
プログラムが正常に実行されました。
1
使用法、構文または設定ファイルのエラーです。
2
操作のエラーです。
3
子プロセスが 0 でない終了ステータスを返しました。
16
ページ、ファイル、キーワードの対象が存在しないか、一致しませんでした。

環境変数

$MANPATH が設定されている場合、この値はマニュアルページを検索するパスとして使用されます。
Every time man invokes the formatter (nroff, troff, or groff), it adds the contents of $MANROFFOPT to the formatter's command line.
$MANROFFSEQ が設定されている場合、その値は各マニュアルページに対して使用する前処理系の集合として使用されます。デフォルトの前処理系はシステム依存です。
If $MANSECT is set, its value is a colon-delimited list of sections and it is used to determine which manual sections to search and in what order. The default is "1 n l 8 3 2 3posix 3pm 3perl 3am 5 4 9 6 7", unless overridden by the SECTION directive in /etc/manpath.config.
If $MANPAGER or $PAGER is set ($MANPAGER is used in preference), its value is used as the name of the program used to display the manual page. By default, pager is used, falling back to cat if pager is not found or is not executable.

この値は、単純なコマンド名か引数付きのコマンドで、シェルのエスケープ文字 (バックスラッシュ、シングルクォート、ダブルクォート) を使用している場合があります。パイプを使用して複数のコマンドをつなげることはできません。そのような必要性がある場合、表示するファイルを、単一の引数または標準入力として受け取るラッパースクリプトを使用します。

If $MANLESS is set, its value will be used as the default prompt string for the less pager, as if it had been passed using the -r option (so any occurrences of the text $MAN_PN will be expanded in the same way). For example, if you want to set the prompt string unconditionally to “my prompt string”, set $MANLESS to ‘-Psmy prompt string’. Using the -r option overrides this environment variable.
$BROWSER が設定さている場合、この値はコロンで区切られたコマンドのリストとして、 man --html 用のウェブブラウザーとして順番に試されます。それぞれのコマンドでは、 %sgroff の出力を保存したファイル名に、 %% は単一のパーセント記号 (%) に、 %c はコロン (:) にそれぞれ置換されます。
$SYSTEM が設定されている場合、 -m オプションで指定した引数と同様の効果があります。
If $MANOPT is set, it will be parsed prior to man's command line and is expected to be in a similar format. As all of the other man specific environment variables can be expressed as command line options, and are thus candidates for being included in $MANOPT it is expected that they will become obsolete. N.B. All spaces that should be interpreted as part of an option's argument must be escaped.
If $MANWIDTH is set, its value is used as the line length for which manual pages should be formatted. If it is not set, manual pages will be formatted with a line length appropriate to the current terminal (using the value of $COLUMNS, and ioctl(2) if available, or falling back to 80 characters if neither is available). Cat pages will only be saved when the default formatting can be used, that is when the terminal line length is between 66 and 80 characters.
通常、端末以外 (ファイルやパイプなど) に出力する場合、特別なツールが使用しなくても結果を読みやすくするために書式文字は破棄されます。しかしながら、 $MAN_KEEP_FORMATTING を空以外に設定した場合、書式文字が残されます。これにより man と併せて使用するラッパーに書式文字を解釈させることができます。
通常、端末 (通常はページャー) に出力する時、ページャーの表示と干渉するのを避けるため、マニュアルページを整形するコマンドのエラー出力は破棄されます。 groff のようなプログラムは、整列がうまくできないなどの、印字問題に関する比較的軽微なエラーメッセージをしばしば出力します。これは、マニュアルページと併せて表示すると、見苦しく、混乱の原因となります。しかしながら、エラーメッセージを見る必要がある場合、 $MAN_KEEP_STDERR を空以外に設定すると、エラー出力は通常通り表示されます。
システムの実装に依存して、 $LANG および $LC_MESSAGES は、現在のメッセージのロケールを決めるために使用されます。 man は (使用可能であれば、) メッセージをそのロケールで出力します。詳細に関しては setlocale(3) を参照してください。

ファイル

/etc/manpath.config
man-db 設定ファイルです。
/usr/share/man
大域マニュアルページ階層です。

関連項目

apropos(1), groff(1), less(1), manpath(1), nroff(1), troff(1), whatis(1), zsoelim(1), manpath(5), man(7), catman(8), mandb(8)

Documentation for some packages may be available in other formats, such as info(1) or HTML.

歴史

1990, 1991 – Originally written by John W. Eaton (jwe@che.utexas.edu).

1992年12月23日: Rik Faith (faith@cs.unc.edu) が Willem Kasdorp (wkasdo@nikhefk.nikef.nl) によって提供されたパッチを適用しました。

30th April 1994 – 23rd February 2000: Wilf. (G.Wilford@ee.surrey.ac.uk) has been developing and maintaining this package with the help of a few dedicated people.

30th October 1996 – 30th March 2001: Fabrizio Polacco <fpolacco@debian.org> maintained and enhanced this package for the Debian project, with the help of all the community.

31st March 2001 – present day: Colin Watson <cjwatson@debian.org> is now developing and maintaining man-db.

バグ

https://savannah.nongnu.org/bugs/?group=man-db

2021-02-08 2.9.4