I am looking for some help trying to get a command working. I want to find some files only and move them, but when I enter this command:
find /Volumes/NEXSAN/Engine\ Folders/Input/DTO_Proxy/* -type f -mtime +7 -exec mv -v {} /Volumes/NEXSAN/.2BeDeleted4realz/
I get this error
find: -exec: no terminating ";" or "+"
I know I probably have it wrong, but I can't figure out what's missing?
Just terminate the find command with \;
, making sure to include the space before the \;
.
find /Volumes/NEXSAN/Engine\ Folders/Input/DTO_Proxy/* -type f -mtime +7 -exec mv -v {} /Volumes/NEXSAN/.2BeDeleted4realz/ \;
If you want to correct the find
command that you had, it should look like this:
find . -name '*.xml' -exec SetFile -t TEXT {} \;
The *.xml
needs to be quoted so it's passed as a parameter to find
instead of expanded by the shell. The ;
also needs to be escaped so it's passed as part of the parameter to find
and not interpreted by the shell.
Keep in mind this will only work for files within the current directory (and subdirectories) and for any new files created, you would need to run the command again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With