LoginSignup
7
8

More than 5 years have passed since last update.

man の出力をファイルに落とす

Last updated at Posted at 2014-04-28

man の出力をそのままファイルにリダイレクトすると

$ man cat > file

環境や条件次第では制御文字が残っておかしなことになってしまうので
そんな時は col をかませて制御文字をとってあげるとよい。

$ man cat | col -b > file

もちろん git help とかもいけます

$ git help init | col -b > file
$ # やっていることは man git-init と同じことだから当たり前ですけどね

余談

Cygwin 環境で制御文字が残ったのでこの記事を書こうと思ったのですが、Linux(xubuntu 12.04)では man cat > file でなんの問題もなかった・・・。今どきの Linux はそういうものなのか?

7
8
0

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
7
8