[root@localhost ~]# touch [選項] 文件名
選項:YYMMDDhhmm。[root@localhost ~]#touch bols
#建立名為 bols 的空文件
[root@localhost ~]#ll --time=atime bols
#查看文件的訪問時間
-rw-r--r-- 1 root root 0 Sep 25 21:23 bols
#文件上次的訪問時間為 9 月 25 號 21:23
[root@localhost ~]#touch bols
[root@localhost ~]#ll --time=atime bols
-rw-r--r-- 1 root root 0 May 15 16:36 bols
#而如果文件已經存在,則也不會報錯,只是會修改文件的訪問時間。
[root@localhost ~]# touch -d "2017-05-04 15:44" bols
[root@localhost ~]# ll bols; ll --time=atime bols; ll --time=ctime bols
-rw-r--r-- 1 root root 0 May 4 2017 bols
-rw-r--r-- 1 root root 0 May 4 2017 bols
-rw-r--r-- 1 root root 0 Sep 25 21:40 bols
#ctime不會變為設定時間,但更新為當前服務器的時間
新聞熱點
疑難解答