man指令,以及几个和man指令有关的其他指令

[root@localhost ~]# man date
DATE(1)                          User Commands                         DATE(1)

NAME
       date - print or set the system date and time

SYNOPSIS
       date [OPTION]... [+FORMAT]
       date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]

DESCRIPTION
       Display the current time in the given FORMAT, or set the system date.

       -d, --date=STRING
              display time described by STRING, not ‘now’

       -f, --file=DATEFILE
              like --date once for each line of DATEFILE

       -r, --reference=FILE
              display the last modification time of FILE

       -R, --rfc-2822
              output date and time in RFC 2822 format

       --rfc-3339=TIMESPEC
              output  date  and time in RFC 3339 format.  TIMESPEC=‘date’, ‘seconds’, or ‘ns’ for date and time to the
              indicated precision.

       -s, --set=STRING
              set time described by STRING

       -u, --utc, --universal
在上个表格的第一行,您可以看到的是∶『DATE(1)』, DATE 我们知道是指令的名称,(1)这里的数字是有含义的
1 使用者可以操作的指令或可执行档
2 系统核心可呼叫的函数与工具等
3 一些常用的函数(function)与函式库(library)
4 装置档案的说明
5 设定档或者是某些档案的格式
6 游戏(games)
7 惯例与协定等,例如 Linux 标准档案系统、网路协定、ASCII code 等
等的说明内容
8 系统管理员可用的管理指令
9 跟 kernel 有关的文件

[root@localhost ~]# man null
NULL(4)                    Linux Programmer’s Manual                   NULL(4)

NAME
       null, zero - data sink
NULL-4表示的是装置档案。

随后跟着的表格由代号,和说明组成,一下列举部分

NAME简单的指令,资料名称说明

SYNOPSIS简单的指令下达语法(syntax)简介

DESCRIPTION 指令或者文档比较完整的说明

OPIONS 列举出了完整的参数说明

COMMANDS当这个程序在执行的时候可以在程序中下达的指令

FILES这个程序或资料所使用或者参考或链接到的某些档案

SEE ALSO指令或者资料有关的其他说明

EXAMPLE一些可以参考的范例

BUGS相关的bug


man指令的几个按键
输入/date可以查询

man page 常用的按键
[Page Down] 向下翻一页
[Page Up] 向上翻一页
[Home] 去到第一页
[End] 去到最后一页
/string 向『下』搜寻 string 这个字串,如果要搜寻 vbird 的话,就输入 /
vbird
?string 向『上』搜寻 string 这个字串
n, N利用 / 或 ? 来搜寻字串时,可以用 n 来继续下一个搜寻 (不论是 /
或 ?) ,可以利用 N 来进行『反向』搜寻。举例来说,我以 /
vbird 搜寻 vbird 字串, 那么可以 n 继续往下查询,用 N 往上查
询。若以 ?vbird 向上查询 vbird 字串, 那我可以用 n 继续『向
上』查询,用 N 反向查询。
q 结束这次的 man page



man的资料哪里来

不同的distribution可能有差异,一般是在usr/share/man 这个目录,可以修改搜索目录,/etc/man.config文件(其他版本可能是man.config或者manpath.conf)

-f参数
[root@localhost etc]# man -f man
man                  (1)  - format and display the on-line manual pages
man                  (1p)  - display system documentation
man                  (7)  - macros to format man pages
man                 (rpm) - 一组文档工具:man、apropos 和 whatis。
man-pages           (rpm) - 来自 Linux 文档计划的 Man(说明书)页。
man.config [man]     (5)  - configuration data for man
-f获取跟多的相关信息。如上面所示,存在5个man相关的文件存在。我们可以调出指定的文件信息。
man 7 man
man rpm man

man -k date
列出date关键字相关信息

和man相关的指令
[root@linux ~]# whatis [指令或者是资料] <==相当于 man -f [指令或者是资料]
[root@linux ~]# apropos [指令或者是资料] <==相当于 man -k [指令或者是资料]
如whatis ls
列出包含ls关键字的内容

猜你喜欢

转载自liyixing1.iteye.com/blog/1013407