Find what is eating your disk space using Perl

A while ago I’ve wrote a small script which I use to pin down the directories and files which suck off the space from the hard drives, usually it’s some user leaving to big log files, unused project files etc. This script will help you find those files or directories fast.

You will need to install following Perl modules and use root account:

Number::Bytes::Human
Getopt::Long

Here’s how to run it:

To find 15 biggest files on /home

user@computer:$ ./disk_analyze.pl --dir=/home/ --mode=files --limit=15

To find 15 biggest directories on /home

user@computer:$ ./disk_analyze.pl --dir=/home/ --mode=dirs --limit=15

Here is script source code: disk_analyze.pl

Share on TwitterShare on TumblrSubmit to StumbleUponSave on DeliciousDigg ThisSubmit to reddit