ls -l /u02/volestlivelogs01/oradata/ESTDB/archive/*.dbf | sed -e "s/:/ /g" -e "s/ / /g" | perl -lane 'BEGIN {%hash=();} $hash{"$F[5]$F[6]-$F[7]:00"}+= $F[4]; END {foreach $k (sort keys %hash) {print "$k " . int($hash{$k}/(1024*1024)) . " Mb"; } }' |
Friday, 27 February 2009
Perl one-liner to summarize file sizes
Posted by Ook at 03:18 0 comments
Total size of an arbitrary list of files
ls -lrt | grep "Feb 17" | awk '{tot += $5;ct +=1; print $9 " " $5/(1024*1024) "Mb"} END {printf(" Files : %s TOTAL SIZE %4.2f Gb\n",ct,tot/(1024*1024*1024))}' Remove files ls -lrt | grep "Feb 19" | cut -d":" -f2 | cut -d" " -f2 | xargs rm -rf |
Posted by Ook at 03:17 0 comments
Wednesday, 18 February 2009
Total size of an arbitrary list of files
ls -lrt | grep "Feb 17" | awk '{tot += $5;ct +=1; print $9 " " $5/(1024*1024) "Mb"} END {printf(" Files : %s TOTAL SIZE %4.2f Gb\n",ct,tot/(1024*1024*1024))}' |
Posted by Ook at 14:41 0 comments
Subscribe to:
Posts (Atom)