mtime vs ctime vs atime

本文详细解释了文件系统的三种时间属性:mtime(最后修改时间)、ctime(状态改变时间)及atime(最后访问时间)。mtime记录文件内容最后一次被修改的时间;ctime记录文件元数据最后一次更改的时间,包括权限和所有权的变化等;atime则记录文件最后一次被访问的时间。文章还介绍了如何通过不同的命令查看这些时间戳以及一些文件系统的特殊选项。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

mtime: time of last modification (ls -l),
* ctime: time of last status change (ls -lc) and
* atime: time of last access (ls -lu).
Note that ctime is not the time of file creation. Writing to a file changes its mtime, ctime, and atime. A change in file permissions or file ownership changes its ctime and atime. Reading a file changes its atime. File systems mounted with the noatime option do not update the atime on reads, and the relatime option provides for updates only if the previous atime is older than the mtime or ctime. Unlike atime and mtime, ctime cannot be set with utime() (as used e.g. by touch); the only way to set it to an arbitrary value is by changing the system clock.
stat命令可以显示所有
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值