Linux02-帮助手册

目录

一、man手册

1.1 man的基本使用

1.2 mandb更新文档

二、/usr/share/doc  

三、access.redhat.com 门户


一、man手册

1.1 man的基本使用

man就是mannual的缩写,手册的意思。Linux的命令很多,参数选项更多,人脑一般是记不住的,用到某个命令的时候man一下就知道怎么用了。man按照章节的方式,把不同类型的命令放到不同的章节中,章节从1到9,其中管理员最常用的是 man 1  用户命令手册、 man 5 配置文件手册、man 8 系统管理命令手册。在查到的文档中会看到有括号标注,这是为了区分不同章节重名的内容,比如passwd(1)和passwd(5),分别是命令passwd和/etc/passwd文件。

man命令章节
部分 内容分类
1 用户命令(可执行命令和shell)
2 系统调用(从用户空间调用的内核例程)
3 库函数(由程序库提供)
4 特殊文件(比如设备文件)
5 文件格式(用于配置文件和结构)
6 游戏(过去的有趣程序章节)
7 惯例、标准和其他(协议、文件系统)
8 系统管理和特权命令(维护任务)
9 Linux内核API(内核调用)

使用的方式,就是man+章节+要查找的内容。得到手册以后,用不同按键来进行控制,翻看手册。实际上,这些按键的规则和vim编辑器非常相似。

翻看man页面
按键 用途
f 向下翻一个屏幕
b 向上翻一个屏幕
d 向下翻半个屏幕
u 向上翻半个屏幕
/string

在man page中搜索字符串。

这个string允许使用正则表达式的语法

n

继续向下搜索,在man page中继续向下搜索/string字符串
N 继续向上搜索,在man page中继续向上搜索/string字符串
g 跳转到man page的开头
G 跳转到man page的结尾
q 退出

还可以根据关键字搜索。man -k,按照标题搜索;man -K,按照内容搜索。

[student@server0 ~]$ man -k passwd
chpasswd (8)         - update passwords in batch mode
fgetpwent_r (3)      - get passwd file entry reentrantly
getpwent_r (3)       - get passwd file entry reentrantly
gpasswd (1)          - administer /etc/group and /etc/gshadow
grub2-mkpasswd-pbkdf2 (1) - Generate a PBKDF2 password hash.
lpasswd (1)          - Change group or user password
lppasswd (1)         - add, change, or delete digest passwords.
pam_localuser (8)    - require users to be listed in /etc/passwd
passwd (1)           - update user's authentication tokens
sslpasswd (1ssl)     - compute password hashes
passwd (5)           - password file
passwd2des (3)       - RFS password encryption
pwhistory_helper (8) - Helper binary that transfers password hashes from passwd or shadow to opasswd
saslpasswd2 (8)      - set a user's sasl password
smbpasswd (5)        - The Samba encrypted password file
userpasswd (1)       - A graphical tool to allow users to change their passwords.
vncpasswd (1)        - change the VNC password

1.2 mandb更新文档

man文档依赖于mandb命令生成的索引,所以当man不到的时候,用mandb更新一下文档。mandb(8)是一个系统管理命令,需要root权限。

二、/usr/share/doc  

/usr/share/doc目录下放的是包文档和模板配置文件。这些文档和模板配置文件跟随包安装,放到这个目录下面。如果不知道一个包的文档放在哪里,也可以用rpm -qd <package_name>来看文档有哪些。

Linux内核的文档kernel-doc是单独的软件包,不包含在Redhat的光盘里。

三、access.redhat.com 门户

可以直接访问access.redhat.com 门户 获取帮助。地址https://access.redhat.com/documentation/en-us/

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章