Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: size of directory

by zentara (Archbishop)
on Oct 10, 2002 at 15:23 UTC ( #204201=note: print w/replies, xml ) Need Help??


in reply to size of directory

Here's a dirsize method using File::Find.
#!/usr/bin/perl -w use File::Find; use strict; my $total = 0; my $dir = $ARGV[0] || '.'; find sub {$total += -s $_;},$dir; my $megs = sprintf "%5.2f",($total/(1024*1024)); print "Total size of files in $dir:$megs Mbytes\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://204201]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (11)
As of 2018-07-20 13:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (431 votes). Check out past polls.

    Notices?