Help for this page

Select Code to Download


  1. or download this
    find /opt/splunk/syslog/ -iname "*log*" -type f -mtime +30 | perl -wne
    + 'BEGIN { $sum = 0 }; chomp; $sum += (stat)[7]; END { print "$sum\n" 
    +}'
    
  2. or download this
    sub scaleIt {
        my $size_in_bytes = shift;
    ...
        ++$n and $size /= 1024 until $size < 1024;
        return sprintf "%.0f%s", $size, (qw[ B KB MB GB TB ])[$n];
    }