查看
ls -a默認顯示的是修改時間
ls -c / --time=status / --time=ctime顯示的是狀態修改時間(即權限修改時間)
ls -u / --time=use / --time=access / --time=atime表示的是文件訪問時間
修改
touch: 缺少了文件操作數
請嘗試執行“touch --help”來獲取更多信息。
[wei@localhost ~]$ touch --help
用法:touch [選項]... 文件...
將每個的訪問及修改時間都更新為目前時間。
長選項必須用的參數在使用短選項時也是必須的。
-a 只更改訪問時間
-c, --no-create 不創建任何文件
-d, --date=字符串 使用表示的時間而不是目前的時間
-f (此選項不作處理)
-m 只更改修改時間
-r, --reference=FILE use this file's times instead of current time
-t STAMP use [[CC]YY]MMDDhhmm[.ss] instead of current time
--time=WORD change the specified time:
WORD is access, atime, or use: equivalent to -a
WORD is modify or mtime: equivalent to -m
--help 顯示此幫助信息並退出
--version 輸出版本信息並退出
Note that the -d and -t options accept different time-date formats.
-d 或 --date= 使用指定的字符串日期時間,而非系統當前時間,日期字符包括月份,時區,上午(am),下午(pm)等。如:--date="2010-08-08 2:30pm"或--date="2010-08-08 14:30"
-t 使用指定的日期時間,而非當前時間來更改文件的時間屬性。
時間戳的格式:ccyymmddhhmm.SS
分表表示:
cc 年份頭兩位
yy 年份后兩位
mm 月(01-12)
dd 天(01-31)
hh 小時(00-23)
mm 分鍾(00-59)
SS 秒 (00-59)
例一:修改時間為2天之前
touch -d '2 days ago' telnet目錄/
例二:touch -t 200303031536 mm
[wei@localhost telnet目錄]$ ll
總計 4
-rw-rw-r-- 1 boco boco 0 10-25 13:12 mm
[wei@localhost telnet目錄]$ touch -t 200303031536 mm[boco@localhost telnet目錄]$ ll
總計 4
-rw-rw-r-- 1 boco boco 0 2003-03-03 mm
[wei@localhost telnet目錄]$