ITPub博客

首页 > Linux操作系统 > Linux操作系统 > find mtime等时间算法(转)

find mtime等时间算法(转)

原创 Linux操作系统 作者:sxp03 时间:2011-07-22 17:32:28 0 删除 编辑
find mtime等时间算法谨记

经常忘记时间的算法,故记录于此,便于查阅。愿以谨记!

SYSDATE SYSDATE-TO_DATE(20051010,'YYYY
1 2005-11-10 15:28:45 31.6449652777778

$ll
total 288
-rw-r--r-- 1 user user 1610 Oct 1 12:46 DddCDR.20051001.0001gz
-rw-r--r-- 1 user user 926 Oct 3 10:01 DddCDR.20051003.0001gz
-rw-r--r-- 1 user user 268 Oct 5 11:16 DddCDR.20051005.0001gz
-rw-r--r-- 1 user user 369 Oct 6 09:50 DddCDR.20051006.0001gz
-rw-r--r-- 1 user user 436 Oct 7 07:58 DddCDR.20051007.0001gz
-rw-r--r-- 1 user user 297 Oct 8 10:48 DddCDR.20051008.0001gz
-rw-r--r-- 1 user user 819 Oct 9 08:27 DddCDR.20051009.0001gz
-rw-r--r-- 1 user user 965 Oct 10 08:27 DddCDR.20051010.0001gz
-rw-r--r-- 1 user user 2984 Oct 14 10:53 DddCDR.20051014.0001gz
-rw-r--r-- 1 user user 2632 Oct 17 09:57 DddCDR.20051017.0001gz
-rw-r--r-- 1 user user 2764 Oct 20 08:08 DddCDR.20051020.0001gz
-rw-r--r-- 1 user user 1234 Oct 21 12:08 DddCDR.20051021.0001gz
-rw-r--r-- 1 user user 1293 Oct 23 09:39 DddCDR.20051023.0001gz
-rw-r--r-- 1 user user 801 Oct 24 09:35 DddCDR.20051024.0001gz
-rw-r--r-- 1 user user 2730 Oct 27 08:24 DddCDR.20051027.0001gz
-rw-r--r-- 1 user user 1440 Oct 29 08:02 DddCDR.20051029.0001gz
-rw-r--r-- 1 user user 1134 Oct 30 12:57 DddCDR.20051030.0001gz
-rw-r--r-- 1 user user 896 Oct 31 10:13 DddCDR.20051031.0001gz
$find ./ -type f -mtime 31(不加符号,表示时间差之前的当天)
./DddCDR.20051010.0001gz
$find ./ -type f -mtime -31(负符号,表示时间差之内的N天)

./DddCDR.20051014.0001gz
./DddCDR.20051017.0001gz
./DddCDR.20051020.0001gz
./DddCDR.20051021.0001gz
./DddCDR.20051023.0001gz
./DddCDR.20051024.0001gz
./DddCDR.20051027.0001gz
./DddCDR.20051029.0001gz
./DddCDR.20051030.0001gz
./DddCDR.20051031.0001gz
$find ./ -type f -mtime +31(正符号,表示N+1天时间差之前的)

./DddCDR.20051001.0001gz
./DddCDR.20051003.0001gz
./DddCDR.20051005.0001gz
./DddCDR.20051006.0001gz
./DddCDR.20051007.0001gz
./DddCDR.20051008.0001gz
./DddCDR.20051009.0001gz
$

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/540962/viewspace-702873/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2008-03-07

  • 博文量
    32
  • 访问量
    119733