man 所在的目錄結(jié)構(gòu)
默認(rèn)man目錄在/usr/share/man目錄下婿奔,目錄下的內(nèi)容如下所示(最后的數(shù)字代表不同的類型,后面有解釋)
total 384
drwxr-xr-x 1353 root wheel 43296 7 31 00:48 man1
drwxr-xr-x 48 root wheel 1536 7 4 17:03 man4
drwxr-xr-x 195 root wheel 6240 7 31 00:48 man5
drwxr-xr-x 3 root wheel 96 10 7 2017 man6
drwxr-xr-x 54 root wheel 1728 7 4 17:03 man7
drwxr-xr-x 673 root wheel 21536 7 31 00:48 man8
drwxr-xr-x 23 root wheel 736 6 22 13:51 man9
drwxr-xr-x 661 root wheel 21152 10 7 2017 mann
-rw-r--r-- 1 root wheel 153311 8 11 13:15 whatis
進(jìn)入man1中可以看到類似如下內(nèi)容
apt.1 jar.1 perldoc5.18.1 readonly.1
apxs.1 jarsigner.1 perldos.1 red.1
arch.1 java.1 perldos5.18.1 refer.1
asctl.1 java_home.1 perldsc.1 rehash.1
assetutil.1 javac.1 perldsc5.18.1 remotemanagementd.1
at.1 javadoc.1 perldtrace.1 repeat.1
atomicupdatetool.1 javah.1 perldtrace5.18.1 reset.1
manual page 編寫說明宇攻,含義
打開其中某個(gè)文件,比如這里打開who.1文件倡勇,可以看到manual page的具體內(nèi)容
.Dd January 17, 2007
.Dt WHO 1
.Os
.Sh NAME
.Nm who
.Nd display who is logged in
.Sh SYNOPSIS
.Nm
.Op Fl abdHlmpqrsTtu
.Op Ar file
.Nm
.Ar am i
.Sh DESCRIPTION
The
.Nm
utility displays a list of all users currently logged on, showing for
each user the login name, tty name, the date and time of login, and
hostname if not local.
.Pp
Available options:
.Pp
.Bl -tag -width file
.It Fl a
Same as
.Fl bdlprTtu .
- 這里已.開頭的是格式標(biāo)識(shí)逞刷,參考(http://www.schweikhardt.net/man_page_howto.html
)
.B Bold
.BI Bold alternating with italics
.BR Bold alternating with Roman
.I Italics
.IB Italics alternating with bold
.IR Italics alternating with Roman
.RB Roman alternating with bold
.RI Roman alternating with italics
.SM Small (scaled 9/10 of the regular size)
.SB Small bold (not small alternating with bold)
man使用
針對(duì)man目錄的結(jié)構(gòu)我們可以看到有9種類型,具體解釋如下
1 用戶在shell環(huán)境中可以操作的命令或可執(zhí)行文件
2 系統(tǒng)內(nèi)核可調(diào)用的函數(shù)與工具等
3 一些常用的函數(shù)或函數(shù)庫译隘,大部分為C的函數(shù)庫
4 設(shè)備文件的說明亲桥,通常在/dev下的文件
5 配置文件或者是某些文件的格式
6 有些
7 慣例與協(xié)議等,例如Linux文件系統(tǒng)固耘、網(wǎng)絡(luò)協(xié)議题篷、ASCII code等說明
8 系統(tǒng)管理員可用的管理命令
9 跟kernel有關(guān)的文件
如果不記得命令的全名,可以搜索關(guān)鍵字
man -k 要搜索的指令