来源:http://blog.sina.com.cn/s/blog_67178440010101gr.html
这是一个修改。改变是文件的索引节点发生了改变;修改是文本本身的内容发生了变化。[文件的修改时间也叫时间标志(timestamp).]
有时,在许多地方改变时间或者“ctime”被错误地写成“创建时间”,包括某些UNIX参考手册。不要相信他们
下面是我man出来的内容,仅供参考!
st_atime
Time whenfile data was last accessed. Changedby the
following functions: creat(), mknod(), pipe(),
utime(2), andread(2).
st_mtime
Time whendata was last modified. Changed bythe fol-
lowing functions: creat(),mknod(), pipe(), utime(),
andwrite(2).
st_ctime
Time whenfile status was last changed. Changed by the
following functions: chmod(), chown(), creat(),
link(2), mknod(), pipe(), unlink(2), utime(), and
write().
ls显示出的time应该是mtime。
ls显示出的time应该是mtime。
touch后,文件的三个时间应该都会改变,可以试一试。
问题描述
文件的 ctime、mtime、atime 之间有什么区别?
配置信息
解决方法
文件的 Access time,atime 是在读取文件或者执行文件时更改的。
文件的 Modified time,mtime 是在写入文件时随文件内容的更改而更改的。
文件的 Create time,ctime 是在写入文件、更改所有者、权限或链接设置时随 Inode的内容更改而更改的。
因此,更改文件的内容即会更改 mtime 和 ctime,但是文件的 ctime 可能会在 mtime 未发生任何变化时更改 -在权限更改,但是文件内容没有变化的情况下。
ls(1) 命令可用来列出文件的 atime、ctime 和 mtime。
ls -lc filename
ls -lu filename
ls -l filename