目錄
一、man手冊
1.1 man的基本使用
man就是mannual的縮寫,手冊的意思。Linux的命令很多,參數選項更多,人腦一般是記不住的,用到某個命令的時候man一下就知道怎麼用了。man按照章節的方式,把不同類型的命令放到不同的章節中,章節從1到9,其中管理員最常用的是 man 1 用戶命令手冊、 man 5 配置文件手冊、man 8 系統管理命令手冊。在查到的文檔中會看到有括號標註,這是爲了區分不同章節重名的內容,比如passwd(1)和passwd(5),分別是命令passwd和/etc/passwd文件。
部分 | 內容分類 |
---|---|
1 | 用戶命令(可執行命令和shell) |
2 | 系統調用(從用戶空間調用的內核例程) |
3 | 庫函數(由程序庫提供) |
4 | 特殊文件(比如設備文件) |
5 | 文件格式(用於配置文件和結構) |
6 | 遊戲(過去的有趣程序章節) |
7 | 慣例、標準和其他(協議、文件系統) |
8 | 系統管理和特權命令(維護任務) |
9 | Linux內核API(內核調用) |
使用的方式,就是man+章節+要查找的內容。得到手冊以後,用不同按鍵來進行控制,翻看手冊。實際上,這些按鍵的規則和vim編輯器非常相似。
按鍵 | 用途 |
---|---|
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/