linux运维笔记:linux 修改、访问、改变时间简介
mtime modified time 文件的修改时间 文件内容的变化,增加,删除,修改等
ctime change time 文件属性的改变时间 硬链接数量,文件大小,文件权限
atime access time 文件的访问时间 cat
[root@oldboyedu01-nb ~]# ls -l oldboy.txt
-rw-r--r--. 1 root root 17 Sep 25 16:47 oldboy.txt
[root@oldboyedu01-nb ~]# stat oldboy.txt
File: `oldboy.txt'
Size: 17 Blocks: 8 IO Block: 4096 regular file
Device: 803h/2051d Inode: 262707 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/
root)
Access: 2017-09-25 16:47:54.628044632 +0800
Modify: 2017-09-25 16:47:53.059040702 +0800
Change: 2017-09-25 16:47:53.101042388 +0800
#mtime改变
[root@oldboyedu01-nb ~]# stat oldboy.txt
File: `oldboy.txt'
Size: 17 Blocks: 8 IO Block: 4096 regular file
Device: 803h/2051d Inode: 262707 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/root)
Access: 2017-09-25 16:47:54.628044632 +0800
Modify: 2017-09-25 16:47:53.059040702 +0800
Change: 2017-09-25 16:47:53.101042388 +0800
[root@oldboyedu01-nb ~]# echo hello >>oldboy.txt
[root@oldboyedu01-nb ~]# stat oldboy.txt
File: `oldboy.txt'
Size: 23 Blocks: 8 IO Block: 4096 regular file
Device: 803h/2051d Inode: 262707 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/root)
Access: 2017-09-25 16:47:54.628044632 +0800
Modify: 2017-10-17 21:45:10.447937840 +0800
Change: 2017-10-17 21:45:10.447937840 +0800
#ctime改变
[root@oldboyedu01-nb ~]# ln oldboy.txt oldboy.txt-hard
[root@oldboyedu01-nb ~]# stat oldboy.txt
File: `oldboy.txt'
Size: 23 Blocks: 8 IO Block: 4096 regular file
Device: 803h/2051d Inode: 262707 Links: 2
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/
root)
Access: 2017-09-25 16:47:54.628044632 +0800
Modify: 2017-10-17 21:45:10.447937840 +0800
Change: 2017-10-17 21:47:35.328930646 +0800
#atime改变
[root@oldboyedu01-nb ~]# cat oldboy.txt
爱生活 爱宁
hello
[root@oldboyedu01-nb ~]# stat oldboy.txt
File: `oldboy.txt'
Size: 23 Blocks: 8 IO Block: 4096 regular file
Device: 803h/2051d Inode: 262707 Links: 2
Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/
root)
Access: 2017-10-17 21:50:13.969932450 +0800
Modify: 2017-10-17 21:45:10.447937840 +0800
Change: 2017-10-17 21:47:35.328930646 +0800