Balualways
Balualways

Reputation: 4510

Need a shell script that identifies all of the files recursively under a directory that are more than 10MB

Need to have a Shell script that will * Identify all the files [ only files no dir ] under a directory recursively [ includes all sub directories] and list out those files which takes more than 10 MB of space.

Upvotes: 1

Views: 590

Answers (3)

Matthew Flaschen
Matthew Flaschen

Reputation: 284836

find . -size +10M

The + means greater than.

EDIT: I added the directory argument. It's optional for GNU find,

Upvotes: 3

Balualways
Balualways

Reputation: 4510

find . -type f -size +10000000 -print|xargs ls -ld|more 

will be a good alternative

but still what if we do not have the permissions inside the dir to do an ls/find

Upvotes: 2

JohnSmith
JohnSmith

Reputation: 4688

find . -size 10M

Upvotes: 2

Related Questions