Linux Find Large Files

Linux Find Large Files

Postby stephen » Wed Sep 23, 2009 3:25 pm

How do I find out all large files in a directory?
answer found here
http://www.cyberciti.biz/faq/find-large-files-linux/

I have listed some of the command from the above site here:

I Used this command in FREEBSD to
find the large log files
Code: Select all
find /var/log -type f -size +100000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'


or
Code: Select all
du -xak .|sort -n|tail -50


it lists the 50 biggest files or directories sorted by size

or
Code: Select all
du -k | sort -n | perl -ne 'if ( /^(\d+)\s+(.*$)/){$l=log($1+.1);$m=int($l/log(1024)); printf                 ("%6.1f\t%s\t%25s  %s\n",($1/(2**(10*$m))),(("K","M","G","T","P")[$m]),"*"x (1.5*$l),$2);}'

It’ll print out stars and the length of the stars show the usage of each folder / file from smallest to largest on the box. Enjoy!
stephen
 
Posts: 507
Joined: Thu Feb 09, 2006 9:37 am
Location: Brisbane

Return to Linux Server Configuration Notes

Who is online

Users browsing this forum: No registered users and 4 guests

cron