linux 更改ctime_linux 更改ctime

找到答案了,还是wiki给力阿。

atime updates are by far the biggest IO performance deficiency that Linux has today. Getting rid of atime updates would give us more everyday Linux performance than all the pagecache speedups of the past 10 years, _combined_.

As of 2.6.30 (9 June 2009), Linux defaults to relatime,[3] so that it will not update atime on all file reads. The behavior offers sufficient performance for most purposes and should not break any significant applications. Extended discussion of filesystem performance preceded the decision.[4] Indeed, relatime by default was the first patch Linux applied following the 2.6.29 release. In initial patches relatime only updated atime if atime < mtime or atime < ctime;######经实验,正确。和光标移动无关(之前是恰好修改文件后进行了光标移动)######atime是最近访问时间。。。。顾名思义。。。你cat一下它就会变了。。。。。######cat 后,access time没有改变。######

引用来自“$_$”的答案

atime是最近访问时间。。。。顾名思义。。。你cat一下它就会变了。。。。。

你的机器上是变的吗?

这是我的结果:

chenqi@chenqi-OptiPlex-760:~/poky/bitbake$ stat AUTHORS   File: `AUTHORS'   Size: 365           Blocks: 8          IO Block: 4096   regular file Device: 803h/2051d    Inode: 9439976     Links: 1 Access: (0664/-rw-rw-r--)  Uid: ( 1000/  chenqi)   Gid: ( 1000/  chenqi) Access: 2012-08-29 18:57:35.430069290 +0800 Modify: 2012-08-29 18:57:35.354069292 +0800 Change: 2012-08-29 18:57:35.354069292 +0800  Birth: - chenqi@chenqi-OptiPlex-760:~/poky/bitbake$ cat AUTHORS Tim Ansell Phil Blundell Seb Frankengul Holger Freyther Marcin Juszkiewicz Chris Larson Ulrich Luckas Mickey Lauer Richard Purdie Holger Schurig chenqi@chenqi-OptiPlex-760:~/poky/bitbake$ stat AUTHORS   File: `AUTHORS'   Size: 365           Blocks: 8          IO Block: 4096   regular file Device: 803h/2051d    Inode: 9439976     Links: 1 Access: (0664/-rw-rw-r--)  Uid: ( 1000/  chenqi)   Gid: ( 1000/  chenqi) Access: 2012-08-29 18:57:35.430069290 +0800 Modify: 2012-08-29 18:57:35.354069292 +0800 Change: 2012-08-29 18:57:35.354069292 +0800  Birth: - chenqi@chenqi-OptiPlex-760:~/poky/bitbake$ date Wed Aug 29 19:04:17 CST 2012 chenqi@chenqi-OptiPlex-760:~/poky/bitbake$

######

引用来自“ChenQi”的答案

引用来自“$_$”的答案

atime是最近访问时间。。。。顾名思义。。。你cat一下它就会变了。。。。。

你的机器上是变的吗?

这是我的结果:

chenqi@chenqi-OptiPlex-760:~/poky/bitbake$ stat AUTHORS   File: `AUTHORS'   Size: 365           Blocks: 8          IO Block: 4096   regular file Device: 803h/2051d    Inode: 9439976     Links: 1 Access: (0664/-rw-rw-r--)  Uid: ( 1000/  chenqi)   Gid: ( 1000/  chenqi) Access: 2012-08-29 18:57:35.430069290 +0800 Modify: 2012-08-29 18:57:35.354069292 +0800 Change: 2012-08-29 18:57:35.354069292 +0800  Birth: - chenqi@chenqi-OptiPlex-760:~/poky/bitbake$ cat AUTHORS Tim Ansell Phil Blundell Seb Frankengul Holger Freyther Marcin Juszkiewicz Chris Larson Ulrich Luckas Mickey Lauer Richard Purdie Holger Schurig chenqi@chenqi-OptiPlex-760:~/poky/bitbake$ stat AUTHORS   File: `AUTHORS'   Size: 365           Blocks: 8          IO Block: 4096   regular file Device: 803h/2051d    Inode: 9439976     Links: 1 Access: (0664/-rw-rw-r--)  Uid: ( 1000/  chenqi)   Gid: ( 1000/  chenqi) Access: 2012-08-29 18:57:35.430069290 +0800 Modify: 2012-08-29 18:57:35.354069292 +0800 Change: 2012-08-29 18:57:35.354069292 +0800  Birth: - chenqi@chenqi-OptiPlex-760:~/poky/bitbake$ date Wed Aug 29 19:04:17 CST 2012 chenqi@chenqi-OptiPlex-760:~/poky/bitbake$

我的是变的

Jiang@local ~/tmp/test $ stat test

文件:"test"

大小:0         块:0          IO 块:4096   普通空文件

设备:11h/17d Inode:268877      硬链接:1

权限:(0644/-rw-r--r--)  Uid:( 1000/      Jiang)   Gid:( 1000/      Jiang)

最近访问:2012-08-29 19:06:22.200085281 +0800

最近更改:2012-08-29 19:06:22.200085281 +0800

最近改动:2012-08-29 19:06:22.200085281 +0800

创建时间:-

Jiang@local ~/tmp/test $ cat test

Jiang@local ~/tmp/test $ stat test

文件:"test"

大小:0         块:0          IO 块:4096   普通空文件

设备:11h/17d Inode:268877      硬链接:1

权限:(0644/-rw-r--r--)  Uid:( 1000/      Jiang)   Gid:( 1000/      Jiang)

最近访问:2012-08-29 19:06:51.364086914 +0800

最近更改:2012-08-29 19:06:22.200085281 +0800

最近改动:2012-08-29 19:06:22.200085281 +0800

Jiang@local ~/tmp/test $ echo hello > test

Jiang@local ~/tmp/test $ stat test

文件:"test"

大小:6         块:8          IO 块:4096   普通文件

设备:11h/17d Inode:268877      硬链接:1

权限:(0644/-rw-r--r--)  Uid:( 1000/      Jiang)   Gid:( 1000/      Jiang)

最近访问:2012-08-29 19:06:51.364086914 +0800

最近更改:2012-08-29 19:08:02.916090921 +0800

最近改动:2012-08-29 19:08:02.916090921 +0800

创建时间:-

Jiang@local ~/tmp/test $ !cat

cat test

hello

Jiang@local ~/tmp/test $ stat test

文件:"test"

大小:6         块:8          IO 块:4096   普通文件

设备:11h/17d Inode:268877      硬链接:1

权限:(0644/-rw-r--r--)  Uid:( 1000/      Jiang)   Gid:( 1000/      Jiang)

最近访问:2012-08-29 19:08:28.600092359 +0800

最近更改:2012-08-29 19:08:02.916090921 +0800

最近改动:2012-08-29 19:08:02.916090921 +0800

创建时间:-

######你看,你的access time也不是很准确阿。当你echo hello > test后,test的access time没有改变。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值