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?
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?
From
man find
:So it will call the command:
If there are more files than can fit in the argument list
rm
will be called more than once. (This is whatxargs
does.)Without the
{} +
it would just callrm
a bunch of times with no arguments.The
{}
bit is the placeholder for theexec
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.