find: missing argument to `-exec'
this must be a very silly question, but after reading man find several times I haven't been able to figure out how to make it work...
I want to find the files in some folder that match some pattern and that were modified more than XX days ago, and delete them . What I'm using is: Code:
find ~/sync/papers/ -name p*.* -mtime +5 -ls -exec rm{}; find: missing argument to '-exec' I've tried several approaches -rm{} [rm{}] {rm{}} (rm{}) --rm{} but the error persists :( What am I doing wrong??? Is there any other way I can find and delete those files?? Thanks for the help! PavoDive :newbie: |
There should be some space between rm and {}
#find ~/sync/papers/ -name p*.* -mtime +5 -exec rm {} \; And dont put -ls. If you want to use ls, you must use it with -exec. |
note the backslash before the semi-colon as well in pavodive's example
|
Thank you guys! helped a lot!
|
At last I know how to do -exec with find!
These forums will be a source of google-based knowledge for generations to come! |
All times are GMT -5. The time now is 01:10 AM. |