man,显示联机手册条目.
提供有关主题的参考信息,例如命令、子例程和文件。man 命令提供由名称指定的对命令的单行描述。man 命令也提供所有命令的信息,这些命令的描述包含用户指定的关键字集合。
man 命令格式化指定的手册页面集合。如果为 Section 参数指定一个段,那么 man 命令在手册页面的该段中搜索 Title 参数指定的标题。Section 参数的值可以是 1 到 8 的阿拉伯数字或字母。
1 标准命令
2 系统调用
3 库函数/子例程
4 特殊文件
5 文件格式,例如(# man 5 passwd),即可查看该文件中各个字段的含义
6 游戏
7 杂项
8 系统管理员可用的命令
9 内核/内部指令
man -h
-
[root@oracle manpages-zh-1.5]# man -h
-
Cannot open the message catalog "man" for locale "zh_CN.GB2312"
-
(NLSPATH="/usr/share/locale/%l/LC_MESSAGES/%N")
-
-
man, version 1.6f
-
-
usage: man [-adfhktwW] [section] [-M path] [-P pager] [-S list]
-
[-m system] [-p string] name ...
-
-
a : find all matching entries
-
c : do not use cat file
-
d : print gobs of debugging information
-
D : as for -d, but also display the pages
-
f : same as whatis(1)
-
h : print this help message
-
k : same as apropos(1)
-
K : search for a string in all pages
-
t : use troff to format pages for printing
-
w : print location of man page(s) that would be displayed
-
(if no name given: print directories that would be searched)
-
W : as for -w, but display filenames only
-
-
C file : use `file' as configuration file
-
M path : set search path for manual pages to `path'
-
P pager : use program `pager' to display pages
-
S list : colon separated section list
-
m system : search for alternate system's man pages
-
p string : string tells which preprocessors to run
-
e - [n]eqn(1) p - pic(1) t - tbl(1)
-
g - grap(1) r - refer(1) v - vgrind(1)
-a man内定在显示第一个找到的手册之后就会停止搜寻,使用此选项会强迫man显示所有符合name的线上手册,在显示屏上按q键跳转。
-w 不要真的显示线上手册,但显示线上手册的位置.如果没有指定引数则显示man所搜寻的目录列表
-f 全文件匹配,显示所有文条目
-k 关键字匹配
帮助页面
输入man命令(# man passwd)转到帮助页面后:
-
[root@oracle manpages-zh-1.5]# man passwd
-
PASSWD(1) User utilities PASSWD(1)
-
-
NAME
-
passwd - update user’s authentication tokens
-
-
SYNOPSIS
-
passwd [-k] [-l] [-u [-f]] [-d] [-n mindays] [-x maxdays] [-w
-
warndays] [-i inactivedays] [-S] [--stdin] [username]
-
-
DESCRIPTION
-
The passwd utility is used to update user’s authentication
-
token(s).
-
-
This task is achieved through calls to the Linux-PAM and Libuser
-
API. Essentially, it initializes itself as a "passwd" service
-
with Linux-PAM and utilizes configured password modules to
-
authenticate and then update a user’s password.
-
-
A simple entry in the global Linux-PAM configuration file for
-
this service would be:
-
-
#
-
# passwd service entry that does strength checking of
-
# a proposed password before updating it.
-
#
-
passwd password requisite pam_cracklib.so retry=3
-
passwd password required pam_unix.so use_authtok
-
#
-
-
Note, other module types are not required for this application to
-
function correctly.
-
-
OPTIONS
-
-k The option -k, is used to indicate that the update should
-
only be for expired authentication tokens (passwords); the
-
user wishes to keep their non-expired tokens as before.
-
-
-l This option is used to lock the specified account and it
-
:
第一行左上角显示PASSWD(1),在标准命令段1中的passwd帮助信息
最后一行左下角显示冒号(:),在这里可输入命令帮助使用者更好地浏览帮助信息,首先输入h,获得如下帮助信息
-
SUMMARY OF LESS COMMANDS
-
-
Commands marked with * may be preceded by a number, N.
-
Notes in parentheses indicate the behavior if N is given.
-
-
h H Display this help.
-
q :q Q :Q ZZ Exit.
-
---------------------------------------------------------------------------
-
-
MOVING
-
-
e ^E j ^N CR * Forward one line (or N lines).
-
y ^Y k ^K ^P * Backward one line (or N lines).
-
f ^F ^V SPACE * Forward one window (or N lines).
-
b ^B ESC-v * Backward one window (or N lines).
-
z * Forward one window (and set window to N).
-
w * Backward one window (and set window to N).
-
ESC-SPACE * Forward one window, but don't stop at end-of-file.
-
d ^D * Forward one half-window (and set half-window to N).
-
u ^U * Backward one half-window (and set half-window to N).
-
ESC-) RightArrow * Left one half screen width (or N positions).
-
ESC-( LeftArrow * Right one half screen width (or N positions).
-
F Forward forever; like "tail -f".
-
r ^R ^L Repaint screen.
-
R Repaint screen, discarding buffered input.
-
---------------------------------------------------
-
Default "window" is the screen height.
-
Default "half-window" is half of the screen height.
-
---------------------------------------------------------------------------
-
-
SEARCHING
-
-
/pattern * Search forward for (N-th) matching line.
-
?pattern * Search backward for (N-th) matching line.
-
n * Repeat previous search (for N-th occurrence).
-
N * Repeat previous search in reverse direction.
-
ESC-n * Repeat previous search, spanning files.
中文支持
Linux自带的帮助文档尽管有多重语言,但支持中文的发行版少之又少。对于刚开始英语阅读能力一般的程序员,中文支持是有必要的。
1、下载man中文手册包
2、语言环境:设置为中文
-
[root@oracle ~]# echo $LANG
-
zh_CN.UTF-8
-
[root@oracle ~]# export LANG=zh_CN.GB2312
-
[root@oracle ~]# echo $LANG
-
zh_CN.GB2312
3、解压中文手册包到指定目录
-
[root@oracle ~]# mkdir -p /root/man/zh_CN
-
[root@oracle ~]# tar zxvf manpages-zh-1.5.tar.gz
-
[root@oracle ~]# cd manpages-zh-1.5
-
[root@oracle ~]# make
-
mkdir UTF-8
-
cp -r src/man* UTF-8/
-
[root@oracle ~]# cp -r UTF-8/* ~/man/zh_CN/
至此已经将中文手册包安装到自己创建的目录中了
4、测试中文手册包是否安装成功
-
[root@oracle manpages-zh-1.5]# man -w
-
/usr/local/share/man:/usr/share/man/overrides:/usr/share/man/zh_CN:/usr/share/man:/usr/local/java/man:/root/man/zh_CN:/root/man:/usr/man:/usr/local/man
-
[root@oracle manpages-zh-1.5]# man -aw passwd
-
/usr/share/man/man1/passwd.1.gz
-
/usr/share/man/man5/passwd.5.gz
-
/root/man/zh_CN/man5/passwd.5
# man 5 -a passwd
显示英文的,按q键切换到中文帮助。
阅读(1536) | 评论(0) | 转发(0) |