2010年12月2日木曜日

find -mtime +1 find -mtime -1

所有文件都有3个时间信息,保存在文件系统中

atime是文件最后一此读的时间
mtime是文件最后一次写的时间
ctime是i-node信息最后一次写的时间.



[root@netsky test]# date
Thu Feb 12 23:26:41 CST 2009
[root@netsky test]# ll
total 0
-rw-r--r-- 1 root root 0 Feb 10 10:00 1
-rw-r--r-- 1 root root 0 Feb 10 10:00 2
-rw-r--r-- 1 root root 0 Feb 11 10:00 3
-rw-r--r-- 1 root root 0 Feb 11 10:00 4
-rw-r--r-- 1 root root 0 Feb 12 23:21 5
-rw-r--r-- 1 root root 0 Feb 12 23:21 6
-rw-r--r-- 1 root root 0 Feb 13 2009 7
-rw-r--r-- 1 root root 0 Feb 13 2009 8
[root@netsky test]# find . -mtime +1
./2
./1
[root@netsky test]# find . -mtime 1
./3
./4
[root@netsky test]# find . -mtime -1
.
./5
./7
./8
./6
[/code]






[root@netsky test]# find . -mtime +0

./2
./1
./3
./4
[root@netsky test]# find . -mtime -0
./7
./8
[root@netsky test]# find . -mtime 0
.
./5
./6

0 件のコメント:

コメントを投稿