Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I'm struggling using the find command that will allow me to find all files that were modified over 7 days ago and that are larger than 1 MB.

Here's what I have -

find /path/to/files* -mtime +7 | -size +1M

But I don't think this is the right syntax.

share|improve this question
2  
read the fine manual. manpagez.com/man/1/find –  Alexej Magura Jul 31 '13 at 19:22
3  
on most systems you really can access the man pages offline. You may try man find –  user1146332 Jul 31 '13 at 19:30

2 Answers 2

Please try the next line

find /path/to/files -mtime +7 -size +1M
share|improve this answer
1  
You have to prepend 7 and 1M with a + sign –  user1146332 Jul 31 '13 at 19:35

The bar | is interpreted by your shell. Try the following

find /path/to/files* -mtime +7 -a -size +1M
share|improve this answer
4  
-and is not portable and actually does nothing in this case. -and is implied. –  jordanm Jul 31 '13 at 19:49
1  
Thanks for the hint! Changed -and to -a. I think a visible operator makes the statement more legible. –  user1146332 Jul 31 '13 at 19:53

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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