「分かりそう」で「分からない」でも「分かった」気になれるIT用語辞典イメージぴよ画像「分かりそう」で「分からない」でも「分かった」気になれるIT用語辞典

manpath【コマンド】

pointこの用語のポイント

pointコマンドだよ

pointUNIX系で使えるよ

point「man」コマンドで表示されるマニュアルの置いてある場所を設定、表示するよ

point「/etc/manpath.config」や「/etc/man_db.conf」の内容に従って設定されるよ

スポンサーリンク

簡単に書くよ

manpath【コマンド】とは

コンピュータさんに対する命令文(コマンド)のひとつ
であり

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


image piyo

詳しく書くよ

「manpath」コマンド

man」コマンドで表示されるマニュアルの置き場所を設定・表示するときに使うコマンド

です。
UNIXLinuxとかMacとか)で使えます。

書き方は

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」が追加されていますね。

基本的な使い方は、それくらいです。
あとは必要に応じて情報を補完してください。


image piyo2

一言でまとめるよ

まぁ「manpath」ってコマンドが出てきたら「マニュアルの置き場所を設定・表示するときに使うんだな~」と お考えください。

一番上に戻るよ
スポンサーリンク
書籍画像001
書籍画像059

おまけ

■訳してみるよ

「man」は多分「manual(マニュアル)」の略です。
「manual(マニュアル)」の意味は「手動の」とか「説明書」とかです。
「path(パス)」の意味は「小道」とか「散歩道」とか「進路」とか「方針」とかです。
何となく くっつけると

説明書までの小道

となります。


■検索してみる?




書籍画像
わわわ説明術コラム
宣伝だよ
「分かった!」と思わせる説明の技術 知識ゼロの相手にも伝わるようになる本【Audible】
実務で役立つ ログの教科書 基礎知識から収集方法・分析手法・トラブルシューティング・パフォーマンス最適化・機械学習での活用まで
つくって、壊して、直して学ぶ Kubernetes入門