Site Fuse! programming, design, hosting, promotion and advertising tips for webmasters

Find big / largest files and directories on a Linux, UNIX, BSD file system

Home  \  Forums  \  IT, Hosting & Domain Forums  \  Linux Server Administration Forums  \  Find big / largest files and directories on a Linux, UNIX, BSD file system
Share   

user photo

MrPhear   1 years, 5 months ago

There is no command available on a linux filesystem to find out what files or directories is eating up all the disk space.

With a combination of three different commands you can easily find out and sort largest files and folders;

du Show file space usage
sort: Sort by size
head: Display first x largest files/directories


so to find out largest 10 files/directories in /home directory type below command at shell prompt;

# du -a /home | sort -n -r | head -n 10


should output;

69810288 /home
67676904 /home/provider
40905912 /home/provider/tmp
38430520 /home/provider/tmp/urchin
38430496 /home/provider/tmp/urchin/data
38404052 /home/provider/tmp/urchin/data/reports
33247784 /home/provider/tmp/urchin/data/reports/sitefuse.com
25618628 /home/provider/public_html
25608776 /home/provider/public_html/up
5012920 /home/provider/tmp/urchin/data/reports/forum.sitefuse.com
user photo
Guest