Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2020-02-18 18:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?










    Results (78 votes). Check out past polls.

    Notices?