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
|
阅读(909) | 评论(0) | 转发(0) |