Can anyone please explain the difference between the following two GNU find options for the -exec argument:
The man page does a good example of explaining that "one might prefer the -exec ... + or better the -execdir ... + syntax for performance and security reasons" but I can't seem to wrap my head around the basic premise of ; vs +
Any help is welcome and appreciated!
The ; syntax executes the command for each single match. The + command runs the command with a long list of matches as arguments to the command.
For example:
$ find
.
./a.txt
./b.png
$ find . -exec echo {} \;
.
./a.txt
./b.png
$ find . -exec echo {} +
. ./a.txt ./b.png
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With