文件访问时间简记(Modify time 和 Change time)

喜你入骨 提交于 2021-01-10 12:50:23
[root@77-29-68-bx-core]# stat hql.out
  File: ‘hql.out’
  Size: 13750       Blocks: 32         IO Block: 4096   regular file
Device: 807h/2055d  Inode: 195302554   Links: 1
Access: (0664/-rw-rw-r--)  Uid: ( 1171/d1_pa)   Gid: ( 1172/d1_pa)
Access: 2019-03-25 20:38:36.885282923 +0800
Modify: 2019-03-25 20:38:36.150282730 +0800
Change: 2019-03-25 20:38:36.150282730 +0800
 Birth: -
[root@77-29-68-bx-core suanec-waic-job-from-weiclient-f7aa171b-58-35522803108336384]# chmod +x hql.out
[root@77-29-68-bx-core suanec-waic-job-from-weiclient-f7aa171b-58-35522803108336384]# stat hql.out
  File: ‘hql.out’
  Size: 13750       Blocks: 32         IO Block: 4096   regular file
Device: 807h/2055d  Inode: 195302554   Links: 1
Access: (0775/-rwxrwxr-x)  Uid: ( 1171/d1_pa)   Gid: ( 1172/d1_pa)
Access: 2019-03-25 20:38:36.885282923 +0800
Modify: 2019-03-25 20:38:36.150282730 +0800
Change: 2019-03-26 11:20:30.613946678 +0800
 Birth: -
[root@77-29-68-bx-core suanec-waic-job-from-weiclient-f7aa171b-58-35522803108336384]# du -sh ./hql.out
16K ./hql.out
[root@77-29-68-bx-core suanec-waic-job-from-weiclient-f7aa171b-58-35522803108336384]# stat hql.out
  File: ‘hql.out’
  Size: 13750       Blocks: 32         IO Block: 4096   regular file
Device: 807h/2055d  Inode: 195302554   Links: 1
Access: (0775/-rwxrwxr-x)  Uid: ( 1171/d1_pa)   Gid: ( 1172/d1_pa)
Access: 2019-03-25 20:38:36.885282923 +0800
Modify: 2019-03-25 20:38:36.150282730 +0800
Change: 2019-03-26 11:20:30.613946678 +0800
 Birth: -
  • 访问文件:vim/sh/bash/cat/more等操作会重置Access time
  • 读取文件属性:ls/stat/wc/du等操作不会重置Access time
  • 修改文件:会重置Modify time 和 Change time
  • 修改权限但不调整内容: 不会重置Modify time, 但会重置 Change time。
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!