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. swift苹果的下一代语言

    http://numbbbbb.github.io/the-swift-programming-language-in-chinese/chapter1/01_swift.html 有时间再看,bas ...

  2. POJ 1091 跳蚤 容斥原理

    分析:其实就是看能否有一组解x1,x2, x3, x4....xn+1,使得sum{xi*ai} = 1,也就是只要有任意一个集合{ai1,ai2,ai3, ...aik|gcd(ai1, ai2, ...

  3. QStringList与QString互转

    QStringList fonts;fonts << "Arial" << "Helvetica" << "Tim ...

  4. Hadoop课程介绍

    一.课程简介 1. Hadoop是什么? Apache Hadoop是一款支持数据密集型分布式应用并以Apache 2.0许可协议发布的开源软件框架.它支持在商品硬件构建的大型集群上运行的应用程序.H ...

  5. Maven、gradle、Ant、Eclipse IDE

    Maven.gradle.Ant.Eclipse IDE之间的关系 http://wenku.baidu.com/view/d33208810912a21615792910.html?from=sea ...

  6. <s:property="a" value=""/>取的<s:debug></s:debug>中的value stack中的属性值

    <s:property="a"  value=""/>取的<s:debug></s:debug>中的value stack中 ...

  7. file的getPath getAbsolutePath和getCanonicalPath的区别

    转自:http://www.blogjava.net/dreamstone/archive/2007/08/08/134968.html file的这几个取得path的方法各有不同,下边说说详细的区别 ...

  8. Oracle查看LogMiner的详解

    Oracle数据库查看日志的方法很多,我们可以根据SQL语句来实现,也可以通过日志查看工具LogMiner来实现,本文我们主要就介绍了这一过程,接下来就让我们一起来了解一下吧.        一.Or ...

  9. 【转】 Android 开发 之 JNI入门 - NDK从入门到精通

    原文网址:http://blog.csdn.net/shulianghan/article/details/18964835 NDK项目源码地址 : -- 第一个JNI示例程序下载 : GitHub  ...

  10. pl/sql developer 编码格式设置

    pl/sql developer编码格式设置   一.pl/sql developer 中文字段显示乱码  原因:因为数据库的编号格式和pl /sql developer的编码格式不统一造成的. 二. ...