Linux 时间戳管理

stat 查看时间戳

文件:metadata, data
查看文件状态:stat

三个时间戳:
access time:(文档最后一次)访问时间,简写为atime,读取文件内容
modify time: 修改时间, mtime,改变文件内容(数据)
change time: 改变时间, ctime,元数据发生改变

1
2
3
Access - the last time the file was read
Modify - the last time the file was modified (content has been modified)
Change - the last time meta data of the file was changed (e.g. permissions)

touch 修改时间戳

1
2
3
4
5
6
touch [OPTION]... FILE...
选项:
-a only atime
-m only mtime
-t STAMP [[CC]YY]MMDDhhmm[.ss]
-c 如果文件不存,则不予创建