当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 3 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : touch -t mtime/atime/ctime
帖子发表于 : 2015-11-15 16:02 
头像

注册: 2015-08-28 16:40
帖子: 44
地址: 烟台
系统: ubuntu
送出感谢: 14
接收感谢: 0 次
lintao@lintao-ubuntu:~/Project$ ll testcopy;ll --time=atime testcopy;ll --time=ctime testcopy
-rw-rw-r-- 1 lintao lintao 0 11月 13 15:39 testcopy
-rw-rw-r-- 1 lintao lintao 0 11月 15 15:39 testcopy
-rw-rw-r-- 1 lintao lintao 0 11月 15 15:39 testcopy

lintao@lintao-ubuntu:~/Project$ touch -t 9009070907 testcopy

lintao@lintao-ubuntu:~/Project$ ll testcopy;ll --time=atime testcopy;ll --time=ctime testcopy
-rw-rw-r-- 1 lintao lintao 0 9月 7 1990 testcopy
-rw-rw-r-- 1 lintao lintao 0 11月 15 15:44 testcopy
-rw-rw-r-- 1 lintao lintao 0 11月 15 15:44 testcopy

为什么atime不变啊。鸟哥的例子mtime和atime都改变了


_________________
站在巨人的肩膀上 thku mina


页首
 用户资料  
 
2 楼 
 文章标题 : Re: touch -t mtime/atime/ctime
帖子发表于 : 2015-11-15 18:21 
头像

注册: 2011-03-20 13:12
帖子: 4519
地址: 山东省寿光县
系统: Debian
送出感谢: 105
接收感谢: 997
会不会是挂载使用了 noatime 选项
代码:
cat /proc/mounts | grep /dev | grep atime

l0b0 写道:
You can turn off access time recording for some file systems (look for noatime in /etc/fstab). To test this, you could try to touch -a file; ls -l --time=atime file, then repeat touch -a file; ls -l --time=atime file to see if it changes.

参考
http://unix.stackexchange.com/a/19893
http://tldp.org/LDP/solrhe/Securing-Optimizing-Linux-RH-Edition-v1.3/chap6sec73.html


_________________
Debian 中文论坛 - forums.debiancn.org
欢迎所有 Debian GNU/Linux 用户


页首
 用户资料  
 
3 楼 
 文章标题 : Re: touch -t mtime/atime/ctime
帖子发表于 : 2015-11-15 19:28 
头像

注册: 2015-08-28 16:40
帖子: 44
地址: 烟台
系统: ubuntu
送出感谢: 14
接收感谢: 0 次
vickycq 写道:
会不会是挂载使用了 noatime 选项
代码:
cat /proc/mounts | grep /dev | grep atime

l0b0 写道:
You can turn off access time recording for some file systems (look for noatime in /etc/fstab). To test this, you could try to touch -a file; ls -l --time=atime file, then repeat touch -a file; ls -l --time=atime file to see if it changes.

参考
http://unix.stackexchange.com/a/19893
http://tldp.org/LDP/solrhe/Securing-Optimizing-Linux-RH-Edition-v1.3/chap6sec73.html



lintao@lintao-ubuntu:~/Project$ lsattr -adR testcopy
-------------e-- testcopy


sudo cat /proc/mounts | grep /dev | grep atime
[sudo] password for lintao:
udev /dev devtmpfs rw,relatime,size=4032304k,nr_inodes=1008076,mode=755 0 0
devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0
/dev/disk/by-uuid/efd0334e-cb47-4458-8a56-0618572e6951 / ext4 rw,relatime,errors=remount-ro,data=ordered 0 0


_________________
站在巨人的肩膀上 thku mina


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 3 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 3 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译