st_atime

Time when
file data was last accessed. Changed
by  the
    
  
   following 
 functions: 
 creat(), 
 mknod(), 
 pipe(),
    
  
   utime(2), and
read(2).

st_mtime

Time when
data was last modified. Changed by
the  fol-
    
  
   lowing  functions:  creat(),
mknod(), pipe(), utime(),
    
  
   and
write(2).

st_ctime

Time when
file status was last changed. Changed by the
    
  
   following 
 functions: 
 chmod(), 
 chown(),  creat(),

link(2),  mknod(),  pipe(),  unlink(2),  utime(),  and

write().

ls显示出的time应该是mtime。

问题描述
文件的 ctime、mtime、atime 之间有什么区别? 
配置信息
解决方法
文件的 Access time,atime 是在读取文件或者执行文件时更改的。
文件的 Modified time,mtime 是在写入文件时随文件内容的更改而更改的。
文件的 Create time,ctime 是在写入文件、更改所有者、权限或链接设置时随 Inode
的内容更改而更改的。

因此,更改文件的内容即会更改 mtime 和 ctime,但是文件的 ctime 可能会在 mtime 未发生任何变化时更改 -
在权限更改,但是文件内容没有变化的情况下。 
ls(1) 命令可用来列出文件的 atime、ctime 和 mtime。
ls -lc filename 
  
    列出文件的
ctime
ls -lu filename 
  
    列出文件的
atime
ls -l filename 
  
     列出文件的
mtime

atime不一定在访问文件之后被修改,因为:使用ext3文件系统的时候,如果在mount的时候使用了noatime参数那么就不会更新atime的
信息。而这是加了 noatime 取消了, 不代表真實情況.反正, 這三個 time stamp 都放在 inode 中.若
mtime, atime 修改, inode 就一定會改, 既然 inode 改了, 那 ctime 也就跟著要改了.之所以在
mount option 中使用 noatime, 就是不想 file system 做太多的修改,
而改善讀取效能.

linux中ctime,mtime,atime的区别的更多相关文章

  1. linux中 su 与 su - 的区别

    linux中 su 与 su - 的区别 su只是切换了用户身份,shell环境仍然是切换前用户的shell环境 su -是用户和shell环境一起切换成. 备注:1.切换了shell环境会相应的用户 ...

  2. linux中ll和du的区别

    首先,明确一个概念,linux中目录其实也是一个文件,它存储了一张表,该表就是该目录文件下,所有文件名和inode的映射关系. 其中inode和数据块block的关系http://c.bianchen ...

  3. linux 文件和文件夹的ctime,mtime,atime的差别

    多了不再赘述,看以下解释 st_atime            Time when file data was last accessed. Changed by  the            f ...

  4. linux find命令mtime/atime/ctime +n -n n 全网最正确的总结

    1.man find 解释: find - search for files in a directory hierarchy,即:在目录下查找文件 2.按文件被修改的时间查询文件 命令格式: fin ...

  5. Linux中exit与_exit的区别

    在exit,_exit的区别 - exit()与_exit()函数的区别(Linux系统中)2012-03-20 15:19:53 分类: LINUX 注:exit()就是退出,传入的参数是程序退出时 ...

  6. Linux中Buffer和Cache的区别

    1. Cache:缓存区,是高速缓存,是位于CPU和主内存之间的容量较小但速度很快的存储器,因为CPU的速度远远高于主内存的速度,CPU从内存中读取数据需等待很长的时间,而  Cache保存着CPU刚 ...

  7. linux中bashrc与profile的区别

    bashrc与profile的区别 要搞清bashrc与profile的区别,首先要弄明白什么是交互式shell和非交互式shell,什么是login shell 和non-login shell. ...

  8. linux中截取字段与#、$区别

    1.Linux shell 截取字符变量的前8位 实现方法有如下几种: expr substr “$a” 1 8 echo $a|awk ‘{print substr(,1,8)}’ echo $a| ...

  9. Linux中文件与目录的区别

    普通文件:存储普通数据,一般就是字符串. 目录文件:存储了一张表,该表就是该目录文件下,所有文件名和索引(inode)的映射关系. 通常父目录会存储有它目录下文件的索引映射,说白了就是一张对应关系的索 ...

随机推荐

  1. mysql查看表的结构

    ①mysql > show create table 表名; ②mysql > desc 表名; ③mysql > describe 表名;

  2. jmeter 启用gzip压缩——解决测试中web服务器上行流量过大的问题

    最近测了几个前端的项目,发现它们都有一个共同点:应用所在服务器的网卡上行(trans)非常大——经常是 117 MB/S,这已经逼近了千兆网卡的极限了.下面记录下排查和解决过程: 一. jmeter ...

  3. 首次接触Winform前端交互

    首次接触到在winform中加入网页,且跟前端脚本交互.找了一下这方面的资料 此博文转载原地址为:http://www.cnblogs.com/Charles2008/archive/2009/08/ ...

  4. 跨平台查询文件时间,如果超过7天,删除该文件(windows和linxu测试过)

    windows调用的是_stat函数,linux调用的是stat函数. #include <time.h> #include <sys/types.h> #include &l ...

  5. boost库在windows下的编译和使用

    因为跨平台的原因,现在要使用到boost库,boost库非常大,现在处于摸索阶段. 首先来说boost库在window下的安装和使用. 一.下载 首先从boost官方主页http://www.boos ...

  6. SGU 130

    SGU130,用k条弦将一个圆分成k+1份的方法数. #include <iostream> #include <vector> #include <string> ...

  7. 转:Build Your First JavaScript Library

    http://net.tutsplus.com/tutorials/javascript-ajax/build-your-first-javascript-library/ Step 1: Creat ...

  8. clone函数

    http://blog.csdn.net/caianye/article/details/5947282 http://wenku.baidu.com/link?url=qnq7laYDYm1V8tl ...

  9. “WIZnet杯”以太网技术竞赛即将开始!

  10. Android 启动过程总结

    SystemServer的启动 frameworks/base/services/java/com/android/server/SystemServer.java: run() 其中调用Activi ...