Linux文件的三个时间概念
2017-05-21 18:24
288 查看
系统保存了这三个时间,分别是Accesstime(访问时间),Modify time(修改时间)和Change time(状态时间)。
官方文档给出的解释:
st_atime
Time when file datawas last accessed. Changed by the
following functions: creat(), mknod(), pipe(),
utime(2), andread(2).
st_mtime
Time when data waslast modified. Changed by the fol-
lowing functions: creat(),mknod(), pipe(), utime(),
and write(2).
st_ctime
Time when filestatus was last changed. Changed by the
following functions: chmod(), chown(), creat(),
link(2), mknod(), pipe(), unlink(2), utime(), and
write().文件的 Accesstime,atime 是在读取文件或者执行文件时更改的。
文件的 Modified time,mtime 是在写入文件时随文件内容的更改而更改的。
文件的 Create time,ctime 是在写入文件、更改所有者、权限或链接设置时随 Inode 的内容更改而更改的。
因此,更改文件的内容即会更改 mtime 和 ctime,但是文件的 ctime 可能会在 mtime 未发生任何变化时更改 - 在权限更改,但是文件内容没有变化的情况下。
ll -c 查看文件的ctime
ll -u 查看文件的atime
ll 查看文件的mtime
touch -m命令修改时间戳 实际上变化的是mtime即文件的修改时间
官方文档给出的解释:
st_atime
Time when file datawas last accessed. Changed by the
following functions: creat(), mknod(), pipe(),
utime(2), andread(2).
st_mtime
Time when data waslast modified. Changed by the fol-
lowing functions: creat(),mknod(), pipe(), utime(),
and write(2).
st_ctime
Time when filestatus was last changed. Changed by the
following functions: chmod(), chown(), creat(),
link(2), mknod(), pipe(), unlink(2), utime(), and
write().文件的 Accesstime,atime 是在读取文件或者执行文件时更改的。
文件的 Modified time,mtime 是在写入文件时随文件内容的更改而更改的。
文件的 Create time,ctime 是在写入文件、更改所有者、权限或链接设置时随 Inode 的内容更改而更改的。
因此,更改文件的内容即会更改 mtime 和 ctime,但是文件的 ctime 可能会在 mtime 未发生任何变化时更改 - 在权限更改,但是文件内容没有变化的情况下。
ll -c 查看文件的ctime
ll -u 查看文件的atime
ll 查看文件的mtime
touch -m命令修改时间戳 实际上变化的是mtime即文件的修改时间
相关文章推荐
- Linux下文件的Access time,Modify time, Change time三个时间的概念、区别和联系。
- Linux下文件的Access time,Modify time, Change time三个时间的概念、区别和联系
- linux下文件的三个时间(Atime ,Mtime,Ctime)
- 小女生的linux技术~~~Linux文件的三个时间
- Linux操作系统下文件的三个时间属性atime 、ctime 、mtime
- Linux系统文件有三个主要的时间属性,分别是ctime(change time), atime(access time), mtime(modify time)
- 【随笔】Linux文件的三个时间属性
- Linux文件和目录的操作(十二) 三个时间 atime mtime ctime
- Linux下文件的三个时间:ctime、mtime、atime的区别
- Linux下的 文件的三个时间参数
- linux下文件的三个主要修改时间(zt)
- Linux下的 文件的三个时间参数
- linux文件的三个主要的修改时间
- linux文件的三个主要的修改时间
- 【Linux】stat命令查看文件的三个时间参数
- Linux下文件的三个时间(Atime,Mtime,Ctime)
- linux文件的三个主要的修改时间
- Linux系统文件有三个主要的时间属性
- Linux文件的三个时间详解
- Linux下文件的三个时间:ctime、mtime、atime的区别