linux中atime mtime ctime 1.mtime(medify time):最後一次修改檔案或目錄的時間2.ctime(chang time) :最後一次改變檔案或目錄(改變的是原資料即:屬性)的時間如:記錄該檔案的inode節點被修改的時間。touch命令除了-d和-t選項外都會改變該時間。而且chmod,chown等命令也能改變該值。3. atime(access time)::最後一次訪問檔案或目錄的時間 對於檔案: 當修改mtime時,ctime必須隨著改變.因為檔案大小等都屬性;有人說說atime也一定會改變,要想修改檔案必須先訪問;其實是不對的不必訪問檔案就能修改其內容:如:#echo “This is a test !” >> /etc/issue,issue檔案內容會變,但並沒有訪問檔案,所以atime並沒有改變. 對於目錄: 訪問一個目錄其atime改變,mtime ,ctime不變;修改一個目錄:在一個目錄下touch一個檔案,mtime與ctime會改變,atime不一定會變;如:[root@station16 ~]# stat /tmp file: `/tmp' size: 135168 Blocks: 280 IO Block: 4096 directoryfevice: fd00h/64768d Inode: 2555905 Links: 8access: (1777/drwxrwxrwt) Uid: ( 0/ root) Gid: ( 0/ root)access: 2010-07-09 09:15:59.000000000 +0800modify: 2010-07-09 09:15:57.000000000 +0800change: 2010-07-09 09:15:57.000000000 +0800[root@station16 ~]# cd /tmp[root@station16 tmp]# touch text.txt[root@station16 ~]# !sstat /tmp file: `/tmp' size: 135168 Blocks: 280 IO Block: 4096 directorydevice: fd00h/64768d Inode: 2555905 Links: 8access: (1777/drwxrwxrwt) Uid: ( 0/ root) Gid: ( 0/ root)access: 2010-07-09 09:15:59.000000000 +0800modify: 2010-07-09 09:31:39.000000000 +0800change: 2010-07-09 09:31:39.000000000 +0800[root@station16 ~]# atime改變,mtime ,ctime不變情況: [root@station16 ~]# stat /tmp File: `/tmp' Size: 135168 Blocks: 280 IO Block: 4096 directorydevice: fd00h/64768d Inode: 2555905 Links: 8access: (1777/drwxrwxrwt) Uid: ( 0/ root) Gid: ( 0/ root)access: 2010-07-09 09:15:59.000000000 +0800modify: 2010-07-09 09:31:39.000000000 +0800change: 2010-07-09 09:31:39.000000000 +0800[root@station16 ~]# cd /tmp[root@station16 tmp]# lsaa text text.txt[root@station16 ~]# !sstat /tmp file: `/tmp' size: 135168 Blocks: 280 IO Block: 4096 directorydevice: fd00h/64768d Inode: 2555905 Links: 8access: (1777/drwxrwxrwt) Uid: ( 0/ root) Gid: ( 0/ root)access: 2010-07-09 09:35:49.000000000 +0800modify: 2010-07-09 09:31:39.000000000 +0800change: 2010-07-09 09:31:39.000000000 +0800 查看檔案的屬性: 使用stat命令可以查看三時間值:如 stat filename 也可使用: ls -l file : 查看檔案修改時間ls -lc file: 查看檔案狀態改動時間ls -lu file: 查看檔案訪問時間