Linux 下的三种时间介绍:

  Access Time:简写为atime,表示文件访问的时间,当文件内容被访问时,更新atime时间

  Modify Time:简写为mtime,表示文件内容修改的时间,当文件的内容被修改时,mtime更新这个时间。

  Change Time:简写为ctime,表示文件的属性修改的时间,当文件的属性被修改时,更ctime这个时间,例如文件的链接数,大小,权限等。

1.查看三种时间

[root@izm5e73eit76putx1pufjoz ~]# stat hello.py

2.atime 时间的修改

[root@izm5e73eit76putx1pufjoz ~]# cat hello.py

通过cat命令查看文件内容,hello.py 文件atime时间由 2018-05-15 16:08:09.340286419 +0800 变更为 2018-05-21 22:44:38.814754266 +0800

3.ctime 时间的修改

[root@izm5e73eit76putx1pufjoz ~]# chmod  hello.py

通过chmod命令修改文件权限,hello.py 文件ctime时间由 2018-05-21 22:28:07.080233378 +0800 变更为 2018-05-21 22:48:59.153704334 +0800

4.mtime 时间修改

[root@izm5e73eit76putx1pufjoz ~]# echo "print 1111" >> hello.py 

通过echo 命令往文件追加内容,hello.py 文件mtime时间由2018-05-15 16:08:06.955176314 +0800 变更为 2018-05-21 22:52:39.178804196 +0800,但是这里我们注意下ctime时间同时也被修改,也就是说修改mtime的时候ctime也会随之更改;

注意:

  ls -l 文件时看到的时间也就是mtime 的时间.

Linux 下的三种时间介绍的更多相关文章

  1. 软硬链接、文件删除原理、linux中的三种时间、chkconfig优化

    第1章 软硬链接 1.1 硬链接 1.1.1 含义 多个文件拥有相同的inode号码 硬链接即文件的多个入口 1.1.2 作用 防止你误删除文件 1.1.3 如何创建硬链接 ln 命令,前面是源文件  ...

  2. linux下的三种解压文件的命令?

    那要看你的压缩文件使用哪种压缩方式:gzip,压缩文件名:zip或gz,解压命令:unzipbzip2,压缩文件名:bz,解压命令:bzip2 -d上面两个是最常用的压缩方式,一般在linux下可以通 ...

  3. Linux - 文件的三种时间之atime、ctime、mtime的区别和简单用法

    在Linux中,文件或者目录中有三个时间属性 atime ctime mtime 简名 全名 中文 作用 atime Access Time 访问时间 最后一次访问文件(读取或执行)的时间 ctime ...

  4. linux中的三种时间

    mtime [修改时间] 文件/目录的修改时间 ctime  [属性修改时间] 文件目录的属性的修改时间 atime  [访问时间]文件/目录的访问时间 stat 123.txt   File: `1 ...

  5. Linux下文件的三种时间标记(atime ctime mtime)

    在windows下,一个文件有:创建时间.修改时间.访问时间. 在Linux下,一个文件有:状态改动时间.修改时间.访问时间. 1)查看文件(或文件夹)的三种时间标记 (stat 命令) Access ...

  6. Linux下文件的三种时间标记:访问时间、修改时间、状态改动时间 (转载)

    在windows下,一个文件有:创建时间.修改时间.访问时间. 而在Linux下,一个文件也有三种时间,分别是:访问时间.修改时间.状态改动时间. 两者有此不同,在Linux下没有创建时间的概念,也就 ...

  7. linux系统编程之信号(八):三种时间结构及定时器setitimer()详解

    一,三种时间结构 time_t://seconds   struct timeval { long tv_sec; /* seconds */ long tv_usec; /* microsecond ...

  8. Spark部署三种方式介绍:YARN模式、Standalone模式、HA模式

    参考自:Spark部署三种方式介绍:YARN模式.Standalone模式.HA模式http://www.aboutyun.com/forum.php?mod=viewthread&tid=7 ...

  9. Linux下的5种I/O模型(转)

    Linux下的五种I/O模型: l         阻塞I/O l         非阻塞I/O l         I/O复用(select.poll.epoll) l         信号驱动I/ ...

随机推荐

  1. day73 母版 中间件

    关于母版自定义的问题 模板引擎: 基本实用{{k1}}  if  for  在页面传参数 并判断  通过母版进行交互 一 模板中自定义函数:操作步骤 1在已经注册的App中创建一个名字叫templat ...

  2. dos命令:批处理

    批处理 一.call命令 1.介绍 从批处理程序调用另一个批处理程序. 2.语法 CALL [drive:][path]filename [batch-parameters] batch-parame ...

  3. Nginx部署vue多项目

    server { listen 80; server_name test.hehe.com; location /riskcontrol { root /data; try_files $uri $u ...

  4. python分析nginx自定义日志

    # -*- coding:utf-8 -*- import datetimeimport re logfile = '''192.168.23.43 - 2017-12-14:00:14:41 /se ...

  5. 小程序 textarea

    1.小程序中textarea不能在scroll-view.swiper.picker-view等等里面运用. 2.不在fixed布局的页面中,placeholder也会随着页面滚动,解决方法:顶级父元 ...

  6. path-control demo js

    THREE.Spline = function(a) { function b(a, b, c, d, e, f, g) { a = 0.5 * (c - a); d = 0.5 * (d - b); ...

  7. display: table; 100%的宽度

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

  8. [LeetCode&Python] Problem 268. Missing Number

    Given an array containing n distinct numbers taken from 0, 1, 2, ..., n, find the one that is missin ...

  9. 特殊符号 sort_wc_uniq命令 tee_tr_split命令

     *     任意个 任意字符 ?    任意一个字符  #     注释字符   \     转意符   |     管道符  (之前有说过) cut  命令: cut  -d "&quo ...

  10. 斐波那契 - pythoon实现

    def fn_1(n): if n == 0 : return n elif n == 1 : return n else: a = [0,1] for i in range(2,n): a.appe ...