1

I'm getting an error while running find like this:

find /var/www/virtual/gm.com/episodes/htdocs/downloaded/ -type f -iname '*flash*' -exec ln -sf {} /var/www/virtual/gm.com/234/htdocs/

find: missing argument to `-exec'. Try 'find --help' for more information.

What's wrong?

8

You're missing the trailing semicolon, which has to be escaped from the shell, such as: \; or ';'.

The find man page says this:

-exec command ;

Execute command; true if 0 status is returned. All following arguments to find are taken to be arguments to the command

...

Attention here:

until an argument consisting of ';' is encountered.

...

The string '{}' is replaced by the current file name being processed everywhere it occurs in the arguments to the command, not just in arguments where it is alone, as in some versions of find. Both of these constructions might need to be escaped (with a '\') or quoted to protect them from expansion by the shell.

...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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