Using semicolon (;) vs plus (+) with exec in find

Why is there a difference in output between using

find . -exec ls '{}' \+

and

find . -exec ls '{}' \;

I got:

$ find . -exec ls  \{\} \+
./file1  ./file2

.:
file1  file2  testdir1

./testdir1:
testdir2

./testdir1/testdir2:


$ find . -exec ls  \{\} \;
file1  file2  testdir1
testdir2
./file2
./file1

6 Answers
6

Leave a Comment