LoginSignup
14
11

More than 3 years have passed since last update.

man コマンドを日本語化する

Last updated at Posted at 2019-09-22

man コマンドを日本語化する

man はコマンドの詳細な説明を表示するコマンドです。
日本語化することで素早くコマンドの使い方を理解することができます。

$ brew install groff
$ sudo vi /etc/man.conf
-------------------------
# 96行目 行頭に「#」を付けてコメントアウト
JNROFF  /usr/bin/groff -Tnippon -mandocj -c
# ↓↓↓↓↓ 最新版に変更
JNROFF  /usr/local/bin/groff -Dutf8 -Tutf8 -mandoc -mja -E

# 106行目 行頭に「#」を付けてコメントアウト
PAGER  /usr/bin/less -is
# ↓↓↓↓↓↓ 日本語表示に対応
PAGER  /usr/bin/less -isr

# 107行目 行頭に「#」を付けてコメントアウト
BROWSER  /usr/bin/less -is
# ↓↓↓↓↓↓ 日本語表示に対応
BROWSER /usr/bin/less -isr
--------------------------
# man のドキュメントをダウンロード
$ curl -O http://linuxjm.osdn.jp/man-pages-ja-20190915.tar.gz
# 最新版は以下からダウンロード
# http://linuxjm.osdn.jp/download.html

$ tar xfz man-pages-ja-20190915.tar.gz
$ cd man-pages-ja-20190915/
$ make config

--------------------------
1. Install directory   [/usr/share/man/ja_JP.UTF-8] ?:
  → インストール先は /usr/local/share/man/ja_JP.UTF-8 と入力
2. compress manual with..
  → 圧縮形式は 0 (none) とする
3.   uname of page owner [root] ?:
  → ユーザ名は root と入力
4. group of page owner [root] ?:
  → グループ名は wheel と入力
5. All OK? (Yes, [C]ontinue / No, [R]eselect) :
  →  c と入力
6. [INSTALL PACKAGE SELECTION]
   (just Return if you accept default choice)
  → デフォルトでOK、100回以上 Enter を押して進める
7. All OK? (Yes, [C]ontinue / No, [R]eselect) :
  → c と入力
8. [RESOLVE CONFLICTS]
   (just Return if you accept item 0)
  → デフォルトのままで良いので、180回以上 Enter を押してそのまま進める
9. All OK? (Yes, [C]ontinue / No, [R]eselect) :
  → c と入力

creating installation script...done
now you can "make install" as user root.

$ sudo make install

※ 日本語化されない場合は以下の通りパスを追加する

$ echo 'export MANPATH=/usr/local/share/man/ja_JP.UTF-8:$(manpath)' >> ~/.zprofile
14
11
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
11