zoukankan      html  css  js  c++  java
  • 文件访问时间简记(Modify time 和 Change time)

    [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。
  • 相关阅读:
    Linux系统-命令行快捷键
    Golang理解-Context包
    Golang理解-垃圾回收机制
    Linux系统-Systemd资源控制
    Linux系统-"cannot access Input/output error"
    Linux系统-ntpdate时间同步报错
    Golang理解-数组和切片
    Golang理解-位运算
    Golang理解-指针
    Maven配置,使用IntelliJ IDEA和Maven创建Java Web项目
  • 原文地址:https://www.cnblogs.com/suanec/p/10599036.html
Copyright © 2011-2022 走看看