I saw this example of a find command:

find -type f -exec ex -sc '%s/abc/def/g' -cx {} ';'

I understand everything up to -cx. what does:

{} ';'

mean? Is that part of the ex command or part of the find command?


`It is part of the find command. From man find (at the actions part):

-exec command {} ;

At the end, an example of the command line:

find . -type f -exec file '{}' \;

The {} and ; parts are escaped to avoid interpretation by the shell.
They mean:

`{}` The file name resulting from the find command.
`;`  End of command line executed by find.

In most modern find implementations you can also use + instead of ; to indicate that {} should be replaced with as many arguments as possible for each invocation of the command.

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.