How to find large files in Linux operating system?

Posted by Jay     5 January, 2010    1,130 views   

Even though Linux OS provides GUI explorer like windows, you have search functionality in windows to find a particular files within the size range. How can we find similar search in command line linux?

Here is the sample command:

From root directory, Finds all files over 20,000KB (roughly 20MB) in size and presents their names and size

find / -type f -size +20000k -exec ls -lh {} \; | awk ‘{ print $9 “: ” $5 }’

From current directory, Finds all files over 20,000KB (roughly 20MB) in size and presents their names and size

find . -type f -size +20000k -exec ls -lh {} \; | awk ‘{ print $9 “: ” $5 }’

I ran this to find more 200MB size file, and got the results in seconds!

find . -type f -size +200000k -exec ls -lh {} \; | awk ‘{ print $9 “: ” $5 }’

Similarly, we can find the same results using this:

find . -type f -size +200000k -exec ls -lh {} \; | awk ‘{ print $NF “: ” $5 }’

You can also sort the highest first in the list using:

find . -type f -size +200000k -exec ls -lh {} \; 2> /dev/null | awk ‘{ print $NF “: ” $5 }’ | sort -nrk 2,2

Post to Twitter  Post to Delicious  Post to Digg    Post to StumbleUpon

Categories : Scripts Unix Tags : ,

Comments
January 10, 2010

as soon as people reolize this price drop them will start buying, the price always stabalized then goes up, its just a trend I’ve seen with past rare crashes. Everyone says it wont and then it does. I expect them to go back up, ALOT, with a bit of time, then drop back down to a stable price similar to what it was.

Posted by ugg boots
March 21, 2010

GOOD post

Posted by Wholelsale
March 21, 2010

A ha?I found it!

Posted by Wholelsale
Leave a comment

(required)

(required)