Chinaunix首页 | 论坛 | 博客
  • 博客访问: 164489
  • 博文数量: 32
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 155
  • 用 户 组: 普通用户
  • 注册时间: 2013-03-08 09:08
个人简介

胖子不是一口吃成滴!

文章分类

全部博文(32)

文章存档

2017年(1)

2016年(4)

2014年(1)

2013年(26)

man

分类: LINUX

2013-04-04 16:14:44

    man,显示联机手册条目.
    提供有关主题的参考信息,例如命令、子例程和文件。man 命令提供由名称指定的对命令的单行描述。man 命令也提供所有命令的信息,这些命令的描述包含用户指定的关键字集合。
man 命令格式化指定的手册页面集合。如果为 Section 参数指定一个段,那么 man 命令在手册页面的该段中搜索 Title 参数指定的标题。Section 参数的值可以是 1 到 8 的阿拉伯数字或字母。
1 标准命令
2 系统调用
3 库函数/子例程
4 特殊文件
5 文件格式,例如(# man 5 passwd),即可查看该文件中各个字段的含义
6 游戏
7 杂项
8 系统管理员可用的命令
9 内核/内部指令

man -h

点击(此处)折叠或打开

  1. [root@oracle manpages-zh-1.5]# man -h
  2. Cannot open the message catalog "man" for locale "zh_CN.GB2312"
  3. (NLSPATH="/usr/share/locale/%l/LC_MESSAGES/%N")
  4. man, version 1.6f
  5. usage: man [-adfhktwW] [section] [-M path] [-P pager] [-S list]
  6. [-m system] [-p string] name ...
  7. a : find all matching entries
  8. c : do not use cat file
  9. d : print gobs of debugging information
  10. D : as for -d, but also display the pages
  11. f : same as whatis(1)
  12. h : print this help message
  13. k : same as apropos(1)
  14. K : search for a string in all pages
  15. t : use troff to format pages for printing
  16. w : print location of man page(s) that would be displayed
  17. (if no name given: print directories that would be searched)
  18. W : as for -w, but display filenames only
  19. C file : use `file' as configuration file
  20. M path : set search path for manual pages to `path'
  21. P pager : use program `pager' to display pages
  22. S list : colon separated section list
  23. m system : search for alternate system's man pages
  24. p string : string tells which preprocessors to run
  25. e - [n]eqn(1) p - pic(1) t - tbl(1)
  26. g - grap(1) r - refer(1) v - vgrind(1)
-a man内定在显示第一个找到的手册之后就会停止搜寻,使用此选项会强迫man显示所有符合name的线上手册,在显示屏上按q键跳转。
-w 不要真的显示线上手册,但显示线上手册的位置.如果没有指定引数则显示man所搜寻的目录列表
-f 全文件匹配,显示所有文条目
-k 关键字匹配

帮助页面
    输入man命令(# man passwd)转到帮助页面后:

点击(此处)折叠或打开

  1. [root@oracle manpages-zh-1.5]# man passwd
  2. PASSWD(1) User utilities PASSWD(1)
  3. NAME
  4. passwd - update user’s authentication tokens
  5. SYNOPSIS
  6. passwd [-k] [-l] [-u [-f]] [-d] [-n mindays] [-x maxdays] [-w
  7. warndays] [-i inactivedays] [-S] [--stdin] [username]
  8. DESCRIPTION
  9. The passwd utility is used to update user’s authentication
  10. token(s).
  11. This task is achieved through calls to the Linux-PAM and Libuser
  12. API. Essentially, it initializes itself as a "passwd" service
  13. with Linux-PAM and utilizes configured password modules to
  14. authenticate and then update a user’s password.
  15. A simple entry in the global Linux-PAM configuration file for
  16. this service would be:
  17. #
  18. # passwd service entry that does strength checking of
  19. # a proposed password before updating it.
  20. #
  21. passwd password requisite pam_cracklib.so retry=3
  22. passwd password required pam_unix.so use_authtok
  23. #
  24. Note, other module types are not required for this application to
  25. function correctly.
  26. OPTIONS
  27. -k The option -k, is used to indicate that the update should
  28. only be for expired authentication tokens (passwords); the
  29. user wishes to keep their non-expired tokens as before.
  30. -l This option is used to lock the specified account and it
  31. :
第一行左上角显示PASSWD(1),在标准命令段1中的passwd帮助信息
最后一行左下角显示冒号(:),在这里可输入命令帮助使用者更好地浏览帮助信息,首先输入h,获得如下帮助信息

点击(此处)折叠或打开

  1. SUMMARY OF LESS COMMANDS
  2. Commands marked with * may be preceded by a number, N.
  3. Notes in parentheses indicate the behavior if N is given.
  4. h H Display this help.
  5. q :q Q :Q ZZ Exit.
  6. ---------------------------------------------------------------------------
  7. MOVING
  8. e ^E j ^N CR * Forward one line (or N lines).
  9. y ^Y k ^K ^P * Backward one line (or N lines).
  10. f ^F ^V SPACE * Forward one window (or N lines).
  11. b ^B ESC-v * Backward one window (or N lines).
  12. z * Forward one window (and set window to N).
  13. w * Backward one window (and set window to N).
  14. ESC-SPACE * Forward one window, but don't stop at end-of-file.
  15. d ^D * Forward one half-window (and set half-window to N).
  16. u ^U * Backward one half-window (and set half-window to N).
  17. ESC-) RightArrow * Left one half screen width (or N positions).
  18. ESC-( LeftArrow * Right one half screen width (or N positions).
  19. F Forward forever; like "tail -f".
  20. r ^R ^L Repaint screen.
  21. R Repaint screen, discarding buffered input.
  22. ---------------------------------------------------
  23. Default "window" is the screen height.
  24. Default "half-window" is half of the screen height.
  25. ---------------------------------------------------------------------------
  26. SEARCHING
  27. /pattern * Search forward for (N-th) matching line.
  28. ?pattern * Search backward for (N-th) matching line.
  29. n * Repeat previous search (for N-th occurrence).
  30. N * Repeat previous search in reverse direction.
  31. ESC-n * Repeat previous search, spanning files.



中文支持
   Linux自带的帮助文档尽管有多重语言,但支持中文的发行版少之又少。对于刚开始英语阅读能力一般的程序员,中文支持是有必要的。
1、下载man中文手册包

点击(此处)折叠或打开

  1. [root@localhost /]# wget
2、语言环境:设置为中文

点击(此处)折叠或打开

  1. [root@oracle ~]# echo $LANG
  2. zh_CN.UTF-8
  3. [root@oracle ~]# export LANG=zh_CN.GB2312
  4. [root@oracle ~]# echo $LANG
  5. zh_CN.GB2312
3、解压中文手册包到指定目录

点击(此处)折叠或打开

  1. [root@oracle ~]# mkdir -p /root/man/zh_CN
  2. [root@oracle ~]# tar zxvf manpages-zh-1.5.tar.gz
  3. [root@oracle ~]# cd manpages-zh-1.5
  4. [root@oracle ~]# make
  5. mkdir UTF-8
  6. cp -r src/man* UTF-8/
  7. [root@oracle ~]# cp -r UTF-8/* ~/man/zh_CN/
至此已经将中文手册包安装到自己创建的目录中了
4、测试中文手册包是否安装成功

点击(此处)折叠或打开

  1. [root@oracle manpages-zh-1.5]# man -w
  2. /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
  3. [root@oracle manpages-zh-1.5]# man -aw passwd
  4. /usr/share/man/man1/passwd.1.gz
  5. /usr/share/man/man5/passwd.5.gz
  6. /root/man/zh_CN/man5/passwd.5
# man 5 -a passwd
显示英文的,按q键切换到中文帮助。
阅读(1536) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~