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 \n 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: -- ::51.110015002 – --> find atime
Modify: -- ::49.508018898 – --> find mtime
Change: -- ::49.508018898 – --> 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 \n in FORMAT.
-t, --terse           print the information in terse form
    --help     display this help and exit
    --version  output version information and exit

stat:查看文件时间参数的更多相关文章

  1. lftp查看文件时间与登录服务查看文件时间相差8小时

    第一步,校正VPS时区设置: rm -rf /etc/localtime ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 第二步,修改FT ...

  2. linux下查看和修改文件时间

    一.查看文件时间及相关命令 1.stat查看文件时间 [root@web10 ~]# stat install.log File: "install.log" Size: 3338 ...

  3. 【linux】如何查看文件的创建、修改时间

    本篇博文旨在介绍Linux下查看文件时间的方法:并介绍如何使用touch指令来进行文件时间的创建以及修改 如何查看文件的时间信息利用stat指令查看文件信息 三种时间的介绍ATime ——文件的最近访 ...

  4. Linux的3个文件时间

    文件的三个时间相信大家都已经很熟悉windows操作系统了,当我们在windows系统下创建一个文件时,系统同时会为这个文件建立相关的参数去描述这个文件,如图: 这些参数包括文件的大小,文件类型,位置 ...

  5. Linux 文件时间记录属性 调优

    Linux 文件时间属性介绍 atime:(access time)显示的是文件中的数据最后被访问的时间,比如系统的进程直接使用或通过一些命令和脚本间接使用.(执行一些可执行文件或脚本) mtime: ...

  6. linux文件时间详细说明

    目录 一:文件时间信息 2 文件时间详细说明 一:文件时间信息 1 文件时间信息分类: 三种时间信息 文件修改时间: mtime 属性修改时间: ctime 文件访问时间: atime 2 查看文件时 ...

  7. Linux中用stat命令查看文件时3个时间点解析

    有些时候,我们需要在Linux中使用stat命令来查看文件的详细信息.另外联想下,ls -l命令显示的是什么时间,touch命令修改文件的时间戳,修改的又是什么时间?在这里我们一起来试验下. 首先,我 ...

  8. linux 下查看文件修改时间,访问时间,状态改变时间

    http://blog.sina.com.cn/s/blog_6285b04e0100f4xr.html 查看文件时间戳命令:stat awk.txt File: `awk.txt' Size: 20 ...

  9. Linux如何查看文件的创建、修改时间?

    Linux如何查看文件的创建.修改时间? 利用stat指令查看文件信息 三种时间的介绍 ATime --文件的最近访问时间 只要读取时间,ATime就会更新 MTime --文件的内容最近修改的时间 ...

随机推荐

  1. asp.net之后台使用根目录运算符

    在asp.net前台,大家会经常使用根目录运算符~.这样,可以不用考虑网站的配置目录. 有时,需要在后台设置路径,同样需要使用根目录运算符.好吧,其实我每次需要使用这种方法,就需要在baidu上查找如 ...

  2. Python 入门 之 双下方法

    Python 入门 之 双下方法 1.双下方法 ​ 定义:双下方法是特殊方法,它是解释器提供的 由双下划线加方法名加双下划线 方法名的具有特殊意义的方法,双下方法主要是python源码程序员使用的,我 ...

  3. PB中的DataStore的应用示例

    编程过程中想在窗口中加一个下拉列表(DDLB),原来听同学说过可以动态改变下拉列表的值,数据库中的表改变,前台客户端的下拉列表就会变,记得当时同学说的是用一个叫下拉数据窗口(DDDW)的东西做的,一直 ...

  4. Bash Plays with Functions CodeForces - 757E (积性函数dp)

    大意: 定义函数$f_r(n)$, $f_0(n)$为pq=n且gcd(p,q)=1的有序对(p,q)个数. $r \ge 1$时, $f_r(n)=\sum\limits_{uv=n}\frac{f ...

  5. c# 不让窗体显示在alt tab中

    protected override CreateParams CreateParams { get { const int WS_EX_APPWINDOW = 0x40000; const int ...

  6. WPF ListView多行显示

    //前台 <ListView Margin="14,152,12,74" Name="lvList" SelectionMode="Multip ...

  7. JS基础_js编写位置

    <!DOCTYPE html> <html> <head> <meta charset="UTF-8"> <title> ...

  8. luogu题解 P1099 【树网的核】树的直径变式+数据结构维护

    题目链接: https://www.luogu.org/problemnew/show/P1099 https://www.lydsy.com/JudgeOnline/problem.php?id=1 ...

  9. 二叉树的C++实现

    这是去年的内容,之前放在github的一个被遗忘的reporsity里面,今天看到了就拿出来 #include<iostream> #include<string> using ...

  10. 让图表的Y轴 产生几个刻度距离

    动态设置max 查看官网 写入方法 获取到你数据最大值 然后+个100