How can I make ls (or any other particular command) to list me only files bigger than a specific file size?

up vote 114 down vote accepted

Use find and its -size flag.

To find files larger than 100MB:

find . -type f -size +100M

If you want the current dir only:

find . -maxdepth 1 -type f -size +100M

If you wish to see all files over 100M and to see where they are and what is their size try this:

find . -type f -size +100M -exec ls -lh {} \;
  • 1
    Does the same as @Nifle's first command – Canadian Luke May 21 '14 at 17:33
  • 1
    I think it would be easier to use printf parameter -printf "%p %s". See: unixhelp.ed.ac.uk/CGI/man-cgi?find – Nux Nov 12 '14 at 13:53
  • @Nux: nice tip. -printf '%9s %p\n' worked well for me. – seanf May 29 '15 at 5:40

Use the following:

find / -size gt 2MB

or:

find / -size => 2000000 
  • 3
    How does this improve the accepted answer? – Dave M Feb 27 '17 at 13:18
  • Though we thank you for your answer, it would be better if it provided additional value on top of the other answers. In this case, your answer does not provide additional value, since another user already posted that solution. If a previous answer was helpful to you, you should vote it up instead of repeating the same information. – Toby Speight Feb 27 '17 at 13:42
  • I like the gt and =>. Thanks. – harperville Feb 7 at 0:19

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.