-exec on find(1) broken

Brian Dessent brian@dessent.net
Tue Oct 9 09:51:00 GMT 2007


Paul McFerrin wrote:

> Well, I finally got it!
> 
>      find . -type f -mtime +18 -exec /bin/echo {} \; | more
> 
> is the correct syntax.  Now I just replace "/bin/echo" with "/bin/rm"
> and I ready to go.

That's still horribly overcomplicated and inefficient.  Use "find .
-type f -mtime +18" to see what the results would be and "find . -type f
-mtime +18 -delete" to delete them.  It's much more efficient to let
find do the deleting than worrying about creating a bunch of echo or rm
child processes.

Brian

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list