mandb【コマンド】
コマンドだよ
UNIX系で使えるよ
「man」コマンドで表示されるマニュアルの索引情報を更新するよ
簡単に書くよ
mandb【コマンド】とは
コンピュータさんに対する命令文(コマンド)のひとつ
であり
「man」コマンドで表示されるやつ(マニュアル)の索引情報を更新するときに使うコマンド
です。
詳しく書くよ
「mandb」コマンドは
「man」コマンドで表示されるマニュアルの索引情報を更新するときに使うコマンド
です。
UNIX系のコンピュータ(LinuxとかMacとか)で使えます。
もったいぶって「マニュアルの索引情報」と書きましたが、要するに「whatisデータベース」のことです。
whatisデータベースは「UNIX系のコンピュータ(LinuxとかMacとか)で使われるデータベースで、マニュアル(「man」コマンドで表示されるやつ)に関する情報が書いてあるファイル」ね。
whatisデータベースは「makewhatis」コマンドを使って作成・更新します。
ところがどっこい、CentOS7には「makewhatis」コマンドがありません。
代わりとなるのが「mandb」コマンドです。
「mandb」コマンドの書き方は
mandb [オプション]
です。
オプションは、あれやこれやとあります。
| オプション | 説明 |
|---|---|
| -d | デバッグ情報を表示する Print debugging information. |
| --debug | デバッグ情報を表示する Print debugging information. |
| -q | 実行中のメッセージを表示しない Produce no warnings. |
| --quiet | 実行中のメッセージを表示しない Produce no warnings. |
| -s | うんちゃら Do not spend time looking for or adding information to the databases regarding stray cats. |
| --no-straycats | かんちゃら Do not spend time looking for or adding information to the databases regarding stray cats. |
| -p | うんちゃら Do not spend time checking for deleted manual pages and purging them from the databases. |
| -no-purge | かんちゃら Do not spend time checking for deleted manual pages and purging them from the databases. |
| -c | 一回全部消して、最初から作り直す By default, mandb will try to update any previously created databases. If a database does not exist, it will create it. This option forces mandb to delete previous databases and re-create them from scratch, and implies --no-purge. This may be necessary if a database becomes corrupt or if a new database storage scheme is introduced in the future. |
| --create | 一回全部消して、最初から作り直す By default, mandb will try to update any previously created databases. If a database does not exist, it will create it. This option forces mandb to delete previous databases and re-create them from scratch, and implies --no-purge. This may be necessary if a database becomes corrupt or if a new database storage scheme is introduced in the future. |
| -u | ユーザのデータベースだけ作る? Create user databases only, even with write permissions necessary to create system databases. |
| --user-db | ユーザのデータベースだけ作る? Create user databases only, even with write permissions necessary to create system databases. |
| -t | 実行したらどうなるかのテストだけやって、実際には実行しない? Perform correctness checks on manual pages in the hierarchy search path. With this option, mandb will not alter existing databases. |
| --test | 実行したらどうなるかのテストだけやって、実際には実行しない? Perform correctness checks on manual pages in the hierarchy search path. With this option, mandb will not alter existing databases. |
| -f【ファイル名】 | 指定したファイルだけ更新する? Update only the entries for the given filename. This option is not for general use; it is used internally by man when it has been compiled with the MAN_DB_UPDATES option and finds that a page is out of date. It implies -p and disables -c and -s. |
| --filename【ファイル名】 | 指定したファイルだけ更新する? Update only the entries for the given filename. This option is not for general use; it is used internally by man when it has been compiled with the MAN_DB_UPDATES option and finds that a page is out of date. It implies -p and disables -c and -s. |
| -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. |
| -? | ヘルプを表示する Show the usage message, then exit. |
| -? | ヘルプを表示する Show the usage message, then exit. |
| --usage | 簡易ヘルプを表示する Print a short usage message and exit. |
| -V | バージョン情報を表示する Show the version, then exit. |
| --version | バージョン情報を表示する Show the version, then exit. |
などです。
基本的な使い方は
mandb
です。
私の環境(CentOS 7)で実行したところ、以下の結果が表示されました。
/usr/share/man 内の古いデータベース要素を取り除いています...
/usr/share/man 配下のマニュアルページを処理しています...
/usr/share/man/cs 内の古いデータベース要素を取り除いています...
/usr/share/man/cs 配下のマニュアルページを処理しています...
/usr/share/man/da 内の古いデータベース要素を取り除いています...
/usr/share/man/da 配下のマニュアルページを処理しています...
/usr/share/man/de 内の古いデータベース要素を取り除いています...
/usr/share/man/de 配下のマニュアルページを処理しています...
/usr/share/man/fr 内の古いデータベース要素を取り除いています...
/usr/share/man/fr 配下のマニュアルページを処理しています...
/usr/share/man/hu 内の古いデータベース要素を取り除いています...
/usr/share/man/hu 配下のマニュアルページを処理しています...
/usr/share/man/id 内の古いデータベース要素を取り除いています...
/usr/share/man/id 配下のマニュアルページを処理しています...
/usr/share/man/it 内の古いデータベース要素を取り除いています...
/usr/share/man/it 配下のマニュアルページを処理しています...
/usr/share/man/ja 内の古いデータベース要素を取り除いています...
/usr/share/man/ja 配下のマニュアルページを処理しています...
/usr/share/man/ko 内の古いデータベース要素を取り除いています...
/usr/share/man/ko 配下のマニュアルページを処理しています...
/usr/share/man/pl 内の古いデータベース要素を取り除いています...
/usr/share/man/pl 配下のマニュアルページを処理しています...
/usr/share/man/pt_BR 内の古いデータベース要素を取り除いています...
/usr/share/man/pt_BR 配下のマニュアルページを処理しています...
/usr/share/man/ru 内の古いデータベース要素を取り除いています...
/usr/share/man/ru 配下のマニュアルページを処理しています...
/usr/share/man/sv 内の古いデータベース要素を取り除いています...
/usr/share/man/sv 配下のマニュアルページを処理しています...
/usr/share/man/tr 内の古いデータベース要素を取り除いています...
/usr/share/man/tr 配下のマニュアルページを処理しています...
/usr/share/man/zh_CN 内の古いデータベース要素を取り除いています...
/usr/share/man/zh_CN 配下のマニュアルページを処理しています...
/usr/share/man/zh_TW 内の古いデータベース要素を取り除いています...
/usr/share/man/zh_TW 配下のマニュアルページを処理しています...
/usr/share/man/sk 内の古いデータベース要素を取り除いています...
/usr/share/man/sk 配下のマニュアルページを処理しています...
/usr/share/man/es 内の古いデータベース要素を取り除いています...
/usr/share/man/es 配下のマニュアルページを処理しています...
/usr/share/man/pt 内の古いデータベース要素を取り除いています...
/usr/share/man/pt 配下のマニュアルページを処理しています...
/usr/local/share/man 内の古いデータベース要素を取り除いています...
/usr/local/share/man 配下のマニュアルページを処理しています...
0 man subdirectories contained newer manual pages.
0 manual pages were added.
0 stray cats were added.
0 old database entries were purged.
なんか、いろいろ更新されるっぽいですね。
オプションの使い方は必要に応じて勉強してください。
一言でまとめるよ
まぁ「mandb」ってコマンドが出てきたら「マニュアルの索引情報を更新するときに使うんだな~」と お考えください。
おまけ
■訳してみるよ
「man」は多分「manual(マニュアル)」の略です。
「manual(マニュアル)」の意味は「手動の」とか「説明書」とかです。
「db」は多分「database(データベース)」の略です。
「data(データ)」の意味は「資料」とか「知識」とか「情報」とかです。
「base(ベース)」の意味は「基地」とか「土台」とかです。
何となく くっつけると
説明書の情報の基地
となります。
■検索してみる?






