本文由我司收集整编,推荐下载,如有疑问,请与我司联系Linux操作系统下文件的三个时间属性atime 、ctime 、mtime
2016/08/22 443 Linux操作系统下有三个主要的时间属性,分别是ctime
(change time),atime(accsess time),mtime(modify time),下面一一解释。
atime: access time,是在读取文件或者执行文件时更改,即文件最后一次被读取时间
说明: atimeTime when file data was last accessed ,changded by the following funtions:
creat ,mknod,pipe,utime,read,` ctime:Change time,是在写入文件、更改所有者、权
限或链接设置时随 Inode 的内容更改而更改,即文件状态最后一次被改变的时间。
说明:ctime Time when file status was last changed. Changed by the following functions:
chmod(), chown(), creat(),link(), mknod(), pipe(), unlink(2),utime(), and write().
mtime:Modified time,是在写入文件时随文件内容的更改而更改,是指文件内容最
后一次被修改的时间。说明: mtime Time when data was last modified. Changed by
the fol- lowing functions: creat(), mknod(), pipe(), utime(), and write(). mtime和ctime
的区别在于,只有修改了文件的内容,才会更新文件的mtime,而对文件更名,修
改文件的属主等操作,只会更新ctime。 举例说明: 对文件进行mv操作,mtime不