How to find files in a directory that are larger than certain size?

I have many files under a directory. How to find those files under the directory that are larger than certain size, say 500MB?

Find the files that are larger than 500MB in the current directory (./):

find ./ -size +500M

Prints our more information about these files:

find ./ -size +500M -exec ls -lh {} ;

Or, more conveniently, sort these results by file sizes:

(find ./ -size +100M -exec ls -lh {} ;) | sort -rh
Answered by Eric Z Ma.

very good answer. Thank you

Eric Z Ma

Eric is a father and systems guy. Eric is interested in building high-performance and scalable distributed systems and related technologies. The views or opinions expressed here are solely Eric's own and do not necessarily represent those of any third parties.

One comment:

  1. Thanks!
    This works for me. “find ./ -size +500M” but in this I want do display with file size of all the outputs “du -sh”

Leave a Reply

Your email address will not be published. Required fields are marked *