LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to: List all files more than 1mb? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-list-all-files-more-than-1mb-324362/)

tobycatlin 05-17-2005 09:34 AM

how to: List all files more than 1mb?
 
Hi ya all

I need to list all of the files in my home directory that are bigger than 1mb.

my best guess is

ls -sh | grep.......

Any help would be great
ta

tobycatlin 05-17-2005 10:32 AM

i need it to recursivly search through sub dirs

Harmaa Kettu 05-17-2005 10:59 AM

Code:

find $HOME -size +1M
Or, if you want the size listed:
Code:

find $HOME -size +1M -exec ls -sh \{\} \;
I hope that I don't scare any newbies away from Linux with this ugly syntax. :)

freakyg 05-17-2005 11:23 AM

you are better off using "find"
the man page will help

man find

tobycatlin 05-18-2005 06:09 AM

thanks
but when i run either of those commands i get

find: invalid -size type `M'

Harmaa Kettu 05-18-2005 07:07 AM

You have old version of the findutils package. Either upgrade it (newest is 4.2.20) or specify the size in kilobytes (+1024k).

tobycatlin 05-18-2005 08:12 AM

Thank you that works a treat.

I run up2date would that not keep findutils up to date (no pun intended)


All times are GMT -5. The time now is 11:12 PM.