Linux系統(tǒng)學(xué)習(xí)之幫助命令(5)

man幫助命令

man [選項(xiàng)] 命令
選項(xiàng):
-f //查看命令擁有那個(gè)級(jí)別的幫助
-k //查看和命令相關(guān)的所有幫助
man的級(jí)別:
1. 查看命令的幫助
2. 查看可被內(nèi)核調(diào)用的函數(shù)的幫助
3. 查看函數(shù)和函數(shù)庫的幫助
4. 查看特殊文件的幫助(主要在/dev文件夾下)
5. 查看配置文件的幫助
6. 查看游戲的幫助
7. 查看其他雜項(xiàng)的幫助
8. 查看系統(tǒng)管理員可用命令的幫助

例子:

[root@centos ~]# man ls
//表示命令級(jí)別                     //表示用戶命令
LS(1)                            User Commands                           LS(1)

NAME
       ls - list directory contents //命令的說明

SYNOPSIS
       ls [OPTION]... [FILE]... //命令的使用方法

DESCRIPTION //下面內(nèi)容是ls的選項(xiàng)與簡化選項(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 說明這個(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的幫助文件  沒有顯示他的執(zhí)行文件,說明cd是shell內(nèi)部命令
cd: /usr/share/man/man1/cd.1.gz /usr/share/man/man1p/cd.1p.gz

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

推薦閱讀更多精彩內(nèi)容