1、幫助命令:man
man 命令 獲取指定命令的幫助
[dmtsai@study ~]$ man date DATE (1) User Commands DATE(1) #注意這個(1),代表的是man命令的幫助等級,也叫區段 NAME <==指令的完整全名,如下所示為date且說明簡單用途為設定與顯示日期/時間 date - print or set the system date and time SYNOPSIS <==指令的基本語法如下所示 date [OPTION]... [+FORMAT] <==第一種單純顯示的用法 date [-u|--utc|--universal] [MMDDhhmm[[ CC]YY][.ss]] <==這種可以設定系統時間的用法 DESCRIPTION <==詳細說明剛剛語法談到的選項與參數的用法 Display the current time in the given FORMAT, or set the system date. Mandatory arguments to long options are mandatory for short options too. -d, --date=STRING <==左邊-d為短選項名稱,右邊--date為完整選項名稱 display time described by STRING, not 'now' -f, --file=DATEFILE like --date once for each line of DATEFILE -I[TIMESPEC], --iso-8601[=TIMESPEC] output date/time in ISO 8601 format. TIMESPEC='date' for date only (the default), 'hours', 'minutes', 'seconds', or 'ns' for date and time to the indicated precision. ....(中間省略).... #下方是格式化輸出的詳細資料 FORMAT controls the output. Interpreted sequences are: %% a literal % %a locale's abbreviated weekday name (eg, Sun) %A locale's full weekday name (eg, Sunday) ....(中間省略).... ENVIRONMENT <==與這個指令相關的環境參數有如下的說明 TZ Specifies the timezone, unless overridden by command line parameters. If neither is specified, the setting from /etc/localtime is used. EXAMPLES <==一堆可用的范本 Convert seconds since the epoch (1970-01-01 UTC) to a date $ date --date='@2147483647' ....(中間省略).... DATE STRING <==上面曾提到的--date的格式說明! The --date=STRING is a mostly free format human readable date string such as "Sun, 29 Feb 2004 16:21:42 -0800" or "2004-02-29 16:21:42" or even "next Thursday". A date string may contain items indicating calendar date, time of day, time zone, day of AUTHOR <==這個指令的作者啦! Written by David MacKenzie. COPYRIGHT <==受到著作權法的保護!用的就是GPL了! Copyright © 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. This is free software: you are free to change and redistribute it. There is NO WAR‐ RANTY, to the extent permitted by law. SEE ALSO <==這個重要,你還可以從哪里查到與date相關的說明文件之意 The full documentation for date is maintained as a Texinfo manual. If the info and date programs are properly installed at your site, the command info coreutils 'date invocation' should give you access to the complete manual. GNU coreutils 8.22 June 2014 DATE(1)
(上方代碼來源:http://linux.vbird.org/linux_basic/0160startlinux.php)
man的幫助級
區段1:用戶指令,查看命令的幫助
區段2:系統調用,查看可被內核調用的函數的幫助
區段3:程序庫調用,查看函數和函數庫的幫助
區段4:設備,查看特殊文件的幫助(主要是/dev目錄下的文件)
區段5:文件格式,查看配置文件的幫助
區段6:游戲,查看游戲的幫助
區段7:雜項,查看其它雜項的幫助
區段8:系統指令,查看系統管理員可用的命令的幫助
區段9:內核內部指令,查看內核相關文件的幫助
區段n:Tcl或Tk指令
2、選項幫助--help
命令 --help 獲取命令選項的幫助
3、shell內部命令幫助
help shell內部命令 獲取shell內部命令的幫助 例: whereis cd 確定是否是shell內部命令,沒有可執行文件的命令是shell內部命令 help cd 獲取內部命令幫助
4、詳細命令幫助info
info 命令 - 回車:進入子幫助頁面(帶有*號標記) - u: 進入上層頁面 - n: 進入下一個幫助小節 - p: 進入上一個幫助小節 - q: 退出