Home » Questions » Computers [ Ask a new question ]

Unix command to list all directories larger than 10mb

Unix command to list all directories larger than 10mb

Is this possible, and what would the command be?

Asked by: Guest | Views: 208
Total answers/comments: 2
Guest [Entry]

"du is the easiest way. Grab the directories of interest with perl.

du -m . | perl -ne '@l = split();print ""@l\n"" if $l[0]>=10'"
Guest [Entry]

"Do like this:

find {/path/to/directory} -type f -size +{file-size-in-kb}k -exec ls -lh {} \; | awk '{ print $8 "": "" $5 }'

Remember to don´t put the {}'s.

In your case do like this:

find / -type f -size +10000k -exec ls -lh {} \; | awk '{ print $8 "": "" $5 }'"