发现cat命令cat一个系统本来就有的文件,cat 后atime时间没有变。如果cat一个自己创建的文件,atime会改变。
如下:1.txt,使用cat查看后,atime改变;/etc/selinux/config文件使用cat命令后atime不变。纠结了!有知道是什么情况的朋友告诉我下,邮箱:[email protected]
当前环境:
[root@backup ~]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) [root@backup ~]# uname -r 3.10.0-957.el7.x86_64
r[root@backup ~]# echo "hello" >1.txt [root@backup ~]# ll total 4 -rw-r--r-- 1 root root 6 Apr 13 20:35 1.txt [root@backup ~]# stat 1.txt File: ‘1.txt’ Size: 6 Blocks: 8 IO Block: 4096 regular file Device: 802h/2050d Inode: 33559406 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2020-04-13 20:35:35.469055828 +0800 #cat前 Modify: 2020-04-13 20:35:35.469055828 +0800 Change: 2020-04-13 20:35:35.469055828 +0800 Birth: - [root@backup ~]# cat 1.txt hello [root@backup ~]# stat 1.txt File: ‘1.txt’ Size: 6 Blocks: 8 IO Block: 4096 regular file Device: 802h/2050d Inode: 33559406 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2020-04-13 20:36:11.916457040 +0800 #atime改变 Modify: 2020-04-13 20:35:35.469055828 +0800 Change: 2020-04-13 20:35:35.469055828 +0800 Birth: - [root@backup ~]# stat /etc/selinux/config File: ‘/etc/selinux/config’ Size: 542 Blocks: 8 IO Block: 4096 regular file Device: 802h/2050d Inode: 101726835 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2020-04-13 13:22:18.506554335 +0800 #cat前 Modify: 2019-04-19 12:35:11.658922642 +0800 Change: 2019-04-19 12:35:11.658922642 +0800 Birth: - [root@backup ~]# cat /etc/selinux/config # This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted [root@backup ~]# stat /etc/selinux/config File: ‘/etc/selinux/config’ Size: 542 Blocks: 8 IO Block: 4096 regular file Device: 802h/2050d Inode: 101726835 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2020-04-13 13:22:18.506554335 +0800 #cat后 Modify: 2019-04-19 12:35:11.658922642 +0800 Change: 2019-04-19 12:35:11.658922642 +0800 Birth: -