系统相关
首页 > 系统相关> > linux 中的 atime mtime ctime

linux 中的 atime mtime ctime

作者:互联网

atime

记录的是文件被访问的时间,通常是读取,如cat命令,在centos7中more,less,head,tail是不会触发atime时间被修改的。

mtime

记录的是文件内容被修改的时间,如果文件被修改则atime和ctime也会被修改。

ctime

记录的是文件属性被修改的时间,包括权限更改,用户或组以及文件大小,文件名,内容被修改时会更新时间。

查看文件的atime,mtime,ctime时间

[root@master test]# stat 1.txt 
  File: ‘1.txt’
  Size: 6         	Blocks: 8          IO Block: 4096   regular file
Device: fd00h/64768d	Inode: 9006882     Links: 1
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)   Gid: (   10/   wheel)
Context: unconfined_u:object_r:admin_home_t:s0
Access: 2021-06-02 13:23:58.552000000 +0800
Modify: 2021-06-02 13:22:02.386000000 +0800
Change: 2021-06-02 13:23:33.247000000 +0800
 Birth: -
[root@master test]# ls -l 1.txt 
-rwxr-xr-x. 1 root wheel 6 Jun  2 13:22 1.txt
[root@master test]# ls -lc 1.txt 
-rwxr-xr-x. 1 root wheel 6 Jun  2 13:23 1.txt
[root@master test]# ls -lu 1.txt 
-rwxr-xr-x. 1 root wheel 6 Jun  2 13:23 1.txt

标签:13,atime,ctime,ls,mtime,txt,root
来源: https://www.cnblogs.com/mfyang/p/14841111.html