Michael Durrant
Michael Durrant

Reputation: 96484

how to do a unix find based on size of files, including in subdirectories?

Trying to use osx find to find all the files in my directory tree. I googled and SO'd and looked at man but none helped.

So far I have: find -f -c1mb which is clearly wrong.

Upvotes: 5

Views: 3526

Answers (4)

MCurbelo
MCurbelo

Reputation: 4143

This command tell you "the size" too :-)

find . -size +1000k -exec du -h {} \;

Upvotes: 1

Teja
Teja

Reputation: 13534

find . -size +20000

The above one should work.

Upvotes: 7

icyrock.com
icyrock.com

Reputation: 28608

On Ubuntu, this works:

find . -type f -size +10k

The above would find all files in the current directory and below, being at least 10k.

Upvotes: 4

Diego Torres Milano
Diego Torres Milano

Reputation: 69228

I guess you want to find files bigger than 1 Mb, then do

$ find . -size +1M

Upvotes: 5

Related Questions