What is the expected order of the files if one executes the following find
command on Linux:
mkdir /tmp/dir1 /tmp/dir2
touch /tmp/dir1/1 /tmp/dir1/2 /tmp/dir2/1 /tmp/dir2/2 /tmp/dir2/3 /tmp/dir2/0
find /tmp/dir1 /tmp/dir2 -name 1 -or -name 0 -not -name 2
/tmp/dir1/1
/tmp/dir2/1
/tmp/dir2/0
Is it supposed to always give the results back from dir1 first, then dir2, or can the results be mixed in order?
The find command will search the directories in the order given. Since you said
find /tmp/dir1 /tmp/dir2 .....
it will always first find evrything that matches below /tmp/dir1, then /tmp/dir2.
Yet, subdirectories and files can, of course, appear in any order.
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