On 05/18/2015 05:36 PM, Ted Byers wrote:
Alas, there seems to be a typo, or something. The following is what I got in the session in which I tried:
ted@gremlin:~> find /var/log/ -type f -mtime +30 -exec rm -rf {}; find: missing argument to `-exec' ted@gremlin:~>
Why would it not see 'rm -rf {}; as the argument for '-exec'?
The ';' is swallowed by the shell - therefore find(1) doesn't see that argument. You have to escape it: $ find /var/log/ -type f -mtime +30 -exec rm -rf '{}' \; Or better use the "+" argument telling find(1) to pass as many arguments to rm(1) as possible at once, thus reducing the number of spawned rm(1) processes: $ find /var/log/ -type f -mtime +30 -exec rm -rf '{}' + ('+' is a GNU extension to find, and thus may be not portable to other implementations like on HP-UX etc.) Have fun, Berny -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org