find ctime ,mtime,atime使用
来源:互联网 发布:javascript用有关var 编辑:程序博客网 时间:2024/05/18 21:40
find . –atime n find . –ctimen find . –mtime n
find . –atime –n find . –ctime–n find . –mtime -n
find . –atime +n find . –ctime+n find . –mtime +n
一、atime、ctime与mtime
atime是指access time,即文件被读取或者执行的时间,修改文件是不会改变access time的。网上很多资料都声称cat、more等读取文件的命令会改变atime,但是我试验时却发现使用cat、more时atime没有被修改。这个问题需要另外做研究探讨。
ctime即change time文件状态改变时间,指文件的i结点被修改的时间,如通过chmod修改文件属性,ctime就会被修改。
mtime即modify time,指文件内容被修改的时间。
使用stat可以查看文件的atime、ctime、mtime。
例:
stat ~/.bashrc
File:`/home/user_00/.bashrc'
Size: 1177 Blocks: 8 IO Block: 4096 regular file
Device: 801h/2049d Inode:663962 Links: 1
Access: (0644/-rw-r--r--) Uid: ( 1003/ user_00) Gid:( 100/ users)
Access: 2009-12-21 10:45:35.000000000 +0800
Modify: 2009-12-21 10:45:35.000000000 +0800
Change: 2009-12-2110:45:35.000000000 +0800
也可以使用ls查看文件的atime、ctime、mtime。
通常情况下我们使用的ls –l ~/.bashrc指示的是文件的modify time。
ls –lu ~/.bashrc 或者ls –l –time=atime~/.bashrc指示的是文件的access time
ls –lc ~/.bashrc 或者ls –l –time=ctime~/.bashrc 指示的是文件的change time
使用touch可以改变这三个时间。关于使用touch改变atime、ctime、mtime的方法,此处不做介绍。
二、find . –mtime中的参数n
find . –mtime n中的n指的是24*n, +n、-n、n分别表示:
+n: 大于n
-n: 小于n
n:等于n
但是man find里这样的解释还是比较令人费解的,不如直接看find . -mtime 中的用法
find . –mtime n: File waslast modified n*24 hours ago.
最后一次修改发生在距离当前时间n*24小时至(n+1)*24 小时
find . –mtime +n:
最后一次修改发生在n+1天以前,距离当前时间为(n+1)*24小时或者更早
find . –mtime –n:
最后一次修改发生在n天以内,距离当前时间为n*24小时以内
- find ctime ,mtime,atime使用
- linux find -ctime -mtime -atime
- mtime,atime,ctime的区别,find命令的使用
- find 中的 -ctime 和 -mtime ,-atime 区别
- find命令之(-atime,-ctime,-mtime)
- atime,mtime,ctime以及find指令
- Linux之 find之 ctime,atime,mtime
- 理解 atime mtime ctime
- atime ctime mtime
- Atime/Mtime/Ctime
- mtime ctime atime ...
- 理解 atime mtime ctime
- ctime mtime atime
- atime ctime mtime
- mtime, ctime, and atime
- mtime,ctime,atime 说明
- linux ctime/mtime/atime
- atime、mtime、ctime
- 【cocos2d-x】利用CCScrollView, 实现帮助界面
- .Net Socket编程基础 -1
- PHPCMS_V9笔记之模板列表
- PHP Http v3.0.0_00
- Android高效加载大图、多图解决方案,有效避免程序OOM
- find ctime ,mtime,atime使用
- 用Visual C#实现端口监听模拟即时通讯
- CentOS下搭建openstack集群
- poj 3160 Father Christmas flymouse (强连通分量+记忆化搜素)
- Linux命令速查
- web开发tips
- objective-c 函数参数 传地址 传指针 指向指针的指针
- iOS 序列化与反序列化
- 给按钮、静态文本 CListCtrl等添加功能提示(tollTip)功能