Chinaunix首页 | 论坛 | 博客
  • 博客访问: 159580
  • 博文数量: 49
  • 博客积分: 1291
  • 博客等级: 中尉
  • 技术积分: 537
  • 用 户 组: 普通用户
  • 注册时间: 2007-07-24 14:10
文章分类

全部博文(49)

文章存档

2015年(3)

2014年(4)

2013年(15)

2011年(1)

2008年(22)

2007年(4)

我的朋友

分类:

2007-07-25 10:09:59

List all files with access time, change time, modify time, size, path
 

find -printf "%A@ %C@ %T@ " -ls > /tmp/myf_sub.out

find files that >10M and modified before one year.

 

#!/usr/bin/perl -w


open FILE1, "/tmp/myf_sub.out";
open YEAR1, ">/tmp/year1";
open YEAR3, ">/tmp/year3";
open YEAR5, ">/tmp/year5";

while (<FILE1>) {
  chomp;
  my @item=split/\s+/;
  if ($item[2]<1167580800 && $item[4]>10000) {
    my $v4= $item[4]/1000;
    if ($item[2] > 1072886400) {
        print YEAR1 "$item[12]-$item[11]-$item[10] $v4 $item[7] $item[13]\n";
                }
        elsif ($item[2]> 1009814400 ) {
                print YEAR3 "$item[12]-$item[11]-$item[10] $v4 $item[7] $item[13]\n";
                }
                else {
                print YEAR5 "$item[12]-$item[11]-$item[10] $v4 $item[7] $item[13]\n";
                }
        }
}

time switch:

1167580800    2007-1-1

1072886400    2004-1-1

1009814400    2002-1-1

阅读(882) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~