搜索此博客

2007年1月8日星期一

About the atime mtime and ctime

Linux的文件系统通常包括change time,access time和modification time这3个时间标签。
st_atime
Time when file data was last accessed. Changed by the
following functions: creat(), mknod(), pipe(),
utime(2), and read(2).
st_mtime
Time when data was last modified. Changed by the fol-
lowing functions: creat(), mknod(), pipe(), utime(),
and write(2).
st_ctime
Time when file status was last changed. Changed by the
following functions: chmod(), chown(), creat(),
link(2), mknod(), pipe(), unlink(2), utime(), and
write().

在实际shell命令中,

  • touch 影响 atime和mtime,可以通过选项开关选择;
  • ls未加选项时,time一栏显示的是mtime;
  • chmod,chown,chgrp影响ctime;
  • 读写操作通常影响atime和mtime;
先记录到这,后续会增加部分解释如何控制这三个标签不被变更。


没有评论: