对于使用rpm包安装的man文件,我们可以直接通过man命令后面跟上要查询的命令进行查看。如man ls ,但对于自定义安装的包。大多是放在安装好的share/man目录。而通过cat查看到的文件内容是:

 1.TH inotifywait 1 "March 14, 2010" "inotifywait 3.14"
 2.SH NAME
 3inotifywait - wait for changes to files using inotify
 4.SH SYNOPSIS
 5.B inotifywait
 6.RB [ -hcmrq ]
 7.RB [ -e
 8<event> ]
 9.RB [ -t
10<seconds> ]
11.RB [ --format
12<fmt> ]
13.RB [ --timefmt
14<fmt> ]
15<file> [ ... ]
16.SH DESCRIPTION
17.B inotifywait
18efficiently waits for changes to files using Linux's
19.BR inotify(7)
20interface.  It is suitable for waiting for changes to files from shell scripts.
21It can either exit once an event occurs, or continually execute and output events
22as they occur.</file></fmt></fmt></seconds></event>

完全不知所云啊,而要像查看其他命令那样。直接 man 后面跟要查看的man文件,会报错。

1[root@web10 man1]# man inotifywait.1
2Cannot open the message catalog "man" for locale "zh_CN.UTF-8"

而要查看这些文件有两种方法:

<pre class="prettyprint lang-bsh">nroff -man man文件名

另外一种方法相对简单,而且会对关键字加粗显示,给人感觉也友好。就是使用less命令:

1less man文件名