man
Linuxコマンドについての説明が見れる。 オンライン上を参照しており、ネットワークへ出れない環境だとエラーが帰る。 デフォルトは英語であり、他言語にするには別途パッケージを導入する必要がある。
使い方
$ man -k ssh # 検索 $ man ssh # 閲覧 $ man 1 ssh # 閲覧(詳細は"セクションについて"を参照) # 閲覧後は[q]で終了
日本語化
yum install -y man-pages-ja
セクションについて
manにはセクション(章番号)があり、以下のように定義されている。
| * | 説明(CentOS7.4.1708 man man より) | 和訳 (Google参考) |
|---|---|---|
| 1 | Executable programs or shell commands | 実行可能プログラムまたはシェルコマンド |
| 2 | System calls (functions provided by the kernel) | システムコール(カーネルが提供する関数) |
| 3 | Library calls (functions within program libraries) | ライブラリ呼び出し(プログラムライブラリ内の関数) |
| 4 | Special files (usually found in /dev) | 特別なファイル(通常は/ devにあります) |
| 5 | File formats and conventions eg /etc/passwd | ファイル形式と規約 例えば、/etc/passwd |
| 6 | Games | ゲーム |
| 7 | Miscellaneous (including macro packages and conventions), e.g. man(7), groff(7) | その他(マクロパッケージや慣習を含む)例えば、man(7), groff(7) |
| 8 | System administration commands (usually only for root) | システム管理コマンド(基本的にrootしか使えない) |
| 9 | Kernel routines [Non standard] | カーネルルーチン[非標準] |
これは、同名のコマンド,ファイルを区別するために用いられている。
例えば、shadowを検索してみると
[user@iw-CentOS7 ~]$ man -k shadow # 検索 : # 略 shadow (3) - encrypted password file routines shadow (5) - shadowed password file : # 略 # 目次 (セクション) 説明
shadow (3)とshadow(5)が存在することがわかる。
これは、ライブラリ内の関数shadowと特殊ファイル/etc/shadowについての説明があるという事になる。
引数を省略した場合(man shadow)はセクションが若い方、つまりライブラリ内の関数shadowの説明が見れる。
特殊ファイル/etc/shadowの説明が見たい場合は、man 5 shadowと明示してやらないといけない。