Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to find big files?

Status
Not open for further replies.

volcano

Programmer
Aug 29, 2000
136
HK
Hi, I have a partition whose storage is nearly full. What commands could I type to find any file being larger than, say, 100MB?

Thank you!
 
find * -size N -exec rm {} ';'


Where N is the size of the file in blocks (512 bytes per block). You can do the maths :)


 
Hi,

If you want to have a listing of the files sorted by size, you can use the following command(s). It will list the files in decreasing order. If you need to do the same thing recursively, you could use the second one.

ls -l | grep \^- | sort -nr -k 5 | more

ls -lR | grep \^- | sort -nr -k 5 | more

I hope this helps.

Ray
 


#find ${PWD} -type f -mount -size +10000000c -exec ls -l {} \; >/tmp/bigfiles$$

You will find all bigfiles more than 10mb in /tmp/bigfiles
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top