man幫助命令
man [選項(xiàng)] 命令
選項(xiàng):
-f //查看命令擁有那個(gè)級(jí)別的幫助
-k //查看和命令相關(guān)的所有幫助
man的級(jí)別:
1. 查看命令的幫助
2. 查看可被內(nèi)核調(diào)用的函數(shù)的幫助
3. 查看函數(shù)和函數(shù)庫(kù)的幫助
4. 查看特殊文件的幫助(主要在/dev文件夾下)
5. 查看配置文件的幫助
6. 查看游戲的幫助
7. 查看其他雜項(xiàng)的幫助
8. 查看系統(tǒng)管理員可用命令的幫助
例子:
[root@centos ~]# man ls
//表示命令級(jí)別 //表示用戶(hù)命令
LS(1) User Commands LS(1)
NAME
ls - list directory contents //命令的說(shuō)明
SYNOPSIS
ls [OPTION]... [FILE]... //命令的使用方法
DESCRIPTION //下面內(nèi)容是ls的選項(xiàng)與簡(jiǎn)化選項(xiàng)
List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort.
Mandatory arguments to long options are mandatory for short options
too.
-a, --all
do not ignore entries starting with .
-A, --almost-all
do not list implied . and ..
--author
with -l, print the author of each file
//如果命令的選項(xiàng)很多吱窝,在此處可以查找你需要的命令
//輸入/-關(guān)鍵字 就可以自動(dòng)跳轉(zhuǎn)到含有關(guān)鍵字的命令上,如:/-d 搜索含有d的選項(xiàng)
//搜索后按n鍵是跳往下一個(gè),shift是跳往上一個(gè)
:
注:man命令在某些版本下需要先安裝莫矗,方法如下:
yum install man*
--help命令
獲取命令“選項(xiàng)”的幫助
命令 --help
例如:ls --help
shell內(nèi)部命令幫助
獲取shell內(nèi)部命令幫助
help shell內(nèi)部命令
例如:help cd
注:使用whereis區(qū)分命令是否是shell內(nèi)部被命令,例如:
[root@centos ~]# whereis ls
//顯示了ls命令的執(zhí)行文件/bin/ls 說(shuō)明這個(gè)命令不是shell內(nèi)部命令
ls: /bin/ls /usr/share/man/man1/ls.1.gz /usr/share/man/man1p/ls.1p.gz
[root@centos ~]# whereis cd
//只顯示的cd的幫助文件 沒(méi)有顯示他的執(zhí)行文件倾贰,說(shuō)明cd是shell內(nèi)部命令
cd: /usr/share/man/man1/cd.1.gz /usr/share/man/man1p/cd.1p.gz