Saturday 15 May 2010

How to find large files in Linux?

In this post, I am discussing about a very useful functionality in linux OS using few commands.
Sometimes required to find some of the files having large size occupied inside the folders, we have easy search functionality in Windows to find a particular files within the size range. But in linux, the same functionality we have to create through command line.

Few examples of this functionality.

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

#find / -type f -size +10000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
From current directory, Finds all files over 10,000KB (around 10MB) in size and presents their names and size

#find . -type f -size +10000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
I ran this to find more 100MB size file, and got the results in seconds!

Related Posts by Categories



No comments: