「分かりそう」で「分からない」でも「分かった」気になれるLinuxコマンド辞典イメージぴよ画像「分かりそう」で「分からない」でも「分かった」気になれるLinuxコマンド辞典

manpath

スポンサーリンク

何するコマンド?

マニュアル(「man」コマンドで表示されるやつ)の置いてある場所を設定・表示するときに使うコマンド



書き方

manpath [オプション]



オプション

オプション説明
-q警告メッセージを表示しない
Do not issue warnings.
--quiet警告メッセージを表示しない
Do not issue warnings.
-dデバッグメッセージを表示する
Print debugging information.
--debugデバッグメッセージを表示する
Print debugging information.
-cProduce a catpath as opposed to a manpath. Once the manpath is determined, each path element is converted to its relative catpath.
--catpathProduce a catpath as opposed to a manpath. Once the manpath is determined, each path element is converted to its relative catpath.
-gProduce a manpath consisting of all paths named as `global' within the man-db configuration file.
--globalProduce a manpath consisting of all paths named as `global' within the man-db configuration file.
-m 【システム】If this system has access to other operating system's manual hierarchies, this option can be used to include them in the output of manpath. To include NewOS's manual page hierarchies use the option -m NewOS. The system specified can be a combination of comma delimited operating system names. To include the native operating system's manual page hierarchies, the system name man must be included in the argument string. This option will override the $SYSTEM environment variable.
-systems=【システム】If this system has access to other operating system's manual hierarchies, this option can be used to include them in the output of manpath. To include NewOS's manual page hierarchies use the option -m NewOS. The system specified can be a combination of comma delimited operating system names. To include the native operating system's manual page hierarchies, the system name man must be included in the argument string. This option will override the $SYSTEM environment variable.
-C【ファイル】指定した設定ファイルを使う
Use this user configuration file rather than the default of ~/.manpath.
--config-file=【ファイル】指定した設定ファイルを使う
Use this user configuration file rather than the default of ~/.manpath.
-?ヘルプを表示する
Print a help message and exit.
--helpヘルプを表示する
Print a help message and exit.
--usage簡易ヘルプを表示する
Print a short usage message and exit.
-Vバージョン情報を表示する
Display version information.
--versionバージョン情報を表示する
Display version information.

補足事項

オプションを何も指定しないで

manpath

を実行すると「/etc/manpath.config」や「/etc/man_db.conf」の内容に従ってマニュアルの場所が設定され、その結果が表示されます。
※私の環境CentOS 7)には「/etc/man_db.conf」が ありました。「/etc/manpath.config」はありませんでした。

つまり「-C」オプションを指定して

manpath -C /etc/man_db.conf

を実行したのと同じ結果になります。

試しに

manpath

を実行したところ、私の環境(CentOS 7)では以下の結果が表示されました。

/usr/local/share/man:/usr/share/man

どうやら「/usr/local/share/man」と「/usr/share/man」がマニュアルの置き場所として指定されているようです。

「-C」オプションは、使う設定ファイルを指定するオプションです。
試しに、以下の内容の「hoge.conf」を用意しました。

MANDATORY_MANPATH    /etc

この状態で

manpath -C hoge.conf

を実行したところ

/usr/local/share/man:/usr/share/man:/etc

と表示されました。
「hoge.conf」に記述した「/etc」が追加されていますね。

スポンサーリンク


書籍画像