[root@centos7 ~]# date
2017年 02月 07日 星期二 16:08:07 CST
# 顯示man中的章節号
[root@centos7 ~]# whatis date
date (1) - print or set the system date and time
date (1p) - write the date and time
[root@centos7 ~]# whatis cal
cal (1) - display a calendar
cal (1p) - print a calendar
[root@centos7 ~]# whatis ifconfig
ifconfig (8) - configure a network interface
[root@centos7 ~]# man -f date
date (1) - print or set the system date and time
date (1p) - write the date and time
[root@centos7 ~]# help type
type: type [-afptP] 名稱 [名稱 ...]
顯示指令類型的資訊。
對于每一個 NAME 名稱,訓示如果作為指令它将如何被解釋。
選項:
-a 顯示所有包含名稱為 NAME 的可執行檔案的位置;
包括别名、内嵌和函數。僅當 `-p' 選項沒有使用時
-f 抑制 shell 函數查詢
-P 為每個 NAME 名稱驚醒 PATH 路徑搜尋,即使它是别名、
内嵌或函數,并且傳回将被執行的磁盤上檔案的名稱。
-p 傳回将被執行的磁盤上檔案的名稱,或者當 `type -t NAME'
不傳回 `file' 時,不傳回任何值。
-t 傳回下列詞中的任何一個`alias'、`keyword'、
`function'、`builtin'、`file'或者`',如果 NAME 是相應的
一個别名、shell 保留字、shell 函數、shell 内嵌、
磁盤檔案或沒有找到。
參數:
NAME 将要解析的指令。
退出狀态:
如果所有的 NAME 指令都找到則傳回成功;任何找不到則失敗。
typeset: typeset [-aAfFgilrtux] [-p] name[=value] ...
設定變量的值和屬性。
廢棄。參見 `help declare'。
2.外部指令擷取幫助
[root@centos7 ~]# date --help
用法:date [選項]... [+格式]
或:date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]]
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 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.
-r, --reference=檔案 顯示檔案指定檔案的最後修改時間
-R, --rfc-2822 以RFC 2822格式輸出日期和時間
例如:2006年8月7日,星期一 12:34:56 -0600
--rfc-3339=TIMESPEC output date and time in RFC 3339 format.
TIMESPEC='date', 'seconds', or 'ns' for
date and time to the indicated precision.
Date and time components are separated by
a single space: 2006-08-07 12:34:56-06:00
-s, --set=STRING set time described by STRING
-u, --utc, --universal print or set Coordinated Universal Time (UTC)
--help 顯示此幫助資訊并退出
--version 顯示版本資訊并退出
給定的格式FORMAT 控制着輸出,解釋序列如下:
%% 一個文字的 %
%a 目前locale 的星期名縮寫(例如: 日,代表星期日)
%A 目前locale 的星期名全稱 (如:星期日)
%b 目前locale 的月名縮寫 (如:一,代表一月)
%B 目前locale 的月名全稱 (如:一月)
%c 目前locale 的日期和時間 (如:2005年3月3日 星期四 23:05:25)
%C 世紀;比如 %Y,通常為省略目前年份的後兩位數字(例如:20)
%d 按月計的日期(例如:01)
%D 按月計的日期;等于%m/%d/%y
%e 按月計的日期,添加空格,等于%_d
%F 完整日期格式,等價于 %Y-%m-%d
%g ISO-8601 格式年份的最後兩位 (參見%G)
%G ISO-8601 格式年份 (參見%V),一般隻和 %V 結合使用
%h 等于%b
%H 小時(00-23)
%I 小時(00-12)
%j 按年計的日期(001-366)
%k hour, space padded ( 0..23); same as %_H
%l hour, space padded ( 1..12); same as %_I
%m month (01..12)
%M minute (00..59)
%n 換行
%N 納秒(000000000-999999999)
%p 目前locale 下的"上午"或者"下午",未知時輸出為空
%P 與%p 類似,但是輸出小寫字母
%r 目前locale 下的 12 小時時鐘時間 (如:11:11:04 下午)
%R 24 小時時間的時和分,等價于 %H:%M
%s 自UTC 時間 1970-01-01 00:00:00 以來所經過的秒數
%S 秒(00-60)
%t 輸出制表符 Tab
%T 時間,等于%H:%M:%S
%u 星期,1 代表星期一
%U 一年中的第幾周,以周日為每星期第一天(00-53)
%V ISO-8601 格式規範下的一年中第幾周,以周一為每星期第一天(01-53)
%w 一星期中的第幾日(0-6),0 代表周一
%W 一年中的第幾周,以周一為每星期第一天(00-53)
%x 目前locale 下的日期描述 (如:12/31/99)
%X 目前locale 下的時間描述 (如:23:13:48)
%y 年份最後兩位數位 (00-99)
%Y 年份