Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As in

find -L /etc/ssl/certs/ -type l -exec rm {} +

So it finds all broken symlinks and deletes them. But how exactly do I interpret the {} + part?

share|improve this question
I didn't know about the "+" variant. Thanks for pointing it out! – wfaulk Oct 9 '09 at 15:33
Did you accept the wrong answer? – Aaron Hall Jul 10 at 22:38
up vote 4 down vote accepted

The {} bit is the placeholder for the exec command. Whatever files are found by find are inserted in place of the brackets. The + means to build up a long list of the found files and call the exec on all of them at once instead of one at a time, like the more traditional -exec {} \; variant.

share|improve this answer

From man find:

   -exec command {} +
   This variant of the -exec option runs the specified  command  on
   the  selected  files, but the command line is built by appending
   each selected file name at the end; the total number of  invoca-
   tions  of  the  command  will  be  much  less than the number of
   matched files.  The command line is built in much the  same  way
   that  xargs builds its command lines.  Only one instance of '{}'
   is allowed within the command.  The command is executed  in  the
   starting directory.

So it will call the command:

rm [filename1] [filename2] [...] [lastfilename]

If there are more files than can fit in the argument list rm will be called more than once. (This is what xargs does.)

Without the {} + it would just call rm a bunch of times with no arguments.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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