• stat:查看文件时间参数


    Linux 系统中,每个文件主要拥有 3 个时间参数,分别是文件的访问时间数据修改时间以及状态修改时间

    • 访问时间(Access Time,简称 atime):只要文件的内容被读取,访问时间就会更新。例如,使用 cat 命令可以查看文件的内容,此时文件的访问时间就会发生改变。
    • 数据修改时间(Modify Time,简称 mtime):当文件的内容数据发生改变,此文件的数据修改时间就会跟着相应改变。
    • 状态修改时间(Change Time,简称 ctime):当文件的状态发生变化,就会相应改变这个时间。比如说,如果文件的权限或者属性发生改变,此时间就会相应改变。
    Usage: stat [OPTION]... FILE...
    Display file or file system status.
     
    -L, --dereference     follow links
    -Z, --context         print the SELinux security context 
    -f, --file-system     display file system status instead of file status
    -c  --format=FORMAT   use the specified FORMAT instead of the default;
                            output a newline after each use of FORMAT
        --printf=FORMAT   like --format, but interpret backslash escapes,
                            and do not output a mandatory trailing newline.
                            If you want a newline, include 
     in FORMAT.
    -t, --terse           print the information in terse form
        --help     display this help and exit
        --version  output version information and exit
    stat /etc/hosts
    Access: 2018-06-30 22:04:51.1100150020700   --> find  atime
    Modify: 2015-06-08 20:34:49.5080188980700   --> find  mtime
    Change: 2015-06-08 20:34:49.5080188980700   --> find  ctime
    Usage: stat [OPTION]... FILE...
    Display file or file system status.
     
    -L, --dereference     follow links
    -Z, --context         print the SELinux security context
    -f, --file-system     display file system status instead of file status
    -c  --format=FORMAT   use the specified FORMAT instead of the default;
                            output a newline after each use of FORMAT
        --printf=FORMAT   like --format, but interpret backslash escapes,
                            and do not output a mandatory trailing newline.
                            If you want a newline, include in FORMAT.
    -t, --terse           print the information in terse form
        --help     display this help and exit
        --version  output version information and exit
  • 相关阅读:
    PHP一维数组转二维数组正则表达式
    PHP IDE选择标准
    PHP导出MySQL数据字典 Summer-Mysql-Dic
    PHP导入导出csv文件 Summer-CSV
    laravel学习
    php markdown 接口文档生成工具 SummerDoc
    AIX系统日志
    inotify+rsync实现实时同步
    shell数组应用
    Nginx缓存功能、防盗链、URL重写
  • 原文地址:https://www.cnblogs.com/pacino12134/p/11481258.html
Copyright © 2020-2023  润新知