您的位置:首页 > 运维架构 > Linux

linux中的ctime atime mtime

2011-05-13 15:58 330 查看
Linux系统中文件的时间有3类,分别是ctime(chage time ) atime(access time ) mtime(modified time),默认情况下ls显示出来的是mtime.这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()
atime ---当文件被读取或执行的时候时间会改变
ctime ---当文件的权限、名称或i-node改变的时候时间会改变
mtime ---当文件内容改变的时候时间会改变,这个时候ctime 和atime也会改变
查看方法--time=atime | ctime --full-time本文出自 “Fight For Free & Union” 博客,请务必保留此出处http://renpeng.blog.51cto.com/623897/564925
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: