Quoting Aris Santillan ([EMAIL PROTECTED]):
> how can i find which folder inside /var have the largest file size?
(1) Write the following out to /usr/local/bin/largest20 :
#!/usr/bin/perl -w
use File::Find;
@ARGV = $ENV{ PWD } unless @ARGV;
find ( sub { $size{ $File::Find::name } = -s if -f; }, @ARGV );
@sorted = sort { $size{ $b } <=> $size{ $a } } keys %size;
splice @sorted, 20 if @sorted > 20;
printf "%10d %s\n", $size{$_}, $_ for @sorted
(2) Do this:
$ su -
# cd /var
# /usr/local/bin/largest20 .
(I'm suggesting running it with root authority only because some parts
of /var might otherwise be inaccessible.)
--
Cheers, "The front line of defense against such sophisticated
Rick Moen viruses is a continually evolving computer operating
[EMAIL PROTECTED] system that attracts the efforts of eager software
developers." -- Bill Gates
_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]
Fully Searchable Archives With Friendly Web Interface at http://marc.free.net.ph
To subscribe to the Linux Newbies' List: send "subscribe" in the body to [EMAIL
PROTECTED]