When doing a search like find -type d, adding the -print0 argument right after the find command such as find -print0 -type d causes the search to return more results than without it.
Find command returns different results when -print0 is added
find
If you understand the && and || operators in the shell(and also in C, C++, and derivative languages),then you understand -a and -o in find.To refresh your memory:In the shell,command1  &&  command2runs command1, and, if it (command1) succeeds,it (the shell) runs command2.command1  ||  command2runs command1, and, if it (command1) fails,it (the shell) runs command2.In the compilable languages,expr1  &&  expr2evaluates expr1. If it (expr1) evaluates to false (zero),it returns that as the value of the overall expression.Otherwise (if expr1 evaluates to a true (non-zero) value),it evaluates expr2 and returns that as the value of the overall expression.expr1  ||  expr2evaluates expr1. If it (expr1) evaluates to a true (non-zero) value,it returns that as the value of the overall expression.Otherwise (if expr1 evaluates to false (zero))it evaluates expr2 and returns that as the value of the overall expression.This is known as short-circuit evaluation,  in that it allows the evaluation of a Boolean expression  without evaluating terms whose values are not needed  to determine the overall value of the expression.Quoting from find(1),GNU find searches the directory tree rooted at each given file nameby evaluating the given expression from left to right,according to the rules of precedence (see section OPERATORS),until the outcome is known(the left hand side is false for and operations, true for or),at which point find moves on to the next file name.EXPRESSIONSThe expression is made up of  tests (which return a true or false value),and actions (which have side effects and return a true or false value),all separated by operators.-and is assumed where the operator is omitted.The subsection on ACTIONS states that -print, likemost of the actions, always returns a value of true.OPERATORSexpr1 expr2expr1 -a expr2expr1 -and expr2 not POSIX compliantAnd; expr2 is not evaluated if expr1 is false.expr1 -o expr2expr1 -or expr2 not POSIX compliantOr; expr2 is not evaluated if expr1 is true.The Open Group Specification for find has similar things to say:The find utility shall recursively descend the directory hierarchy ,evaluating a Boolean expression composed of the primariesdescribed in the OPERANDS section for each file encountered.OPERANDS-printThe primary shall always evaluate as true;it shall cause the current pathname to be written to standard output.The primaries can be combined using the following operators(in order of decreasing precedence):expression [-a] expressionConjunction of primaries; the AND operator is impliedby the juxtaposition of two primariesor made explicit by the optional -a operator.The second expression shall not be evaluatedif the first expression is false.expression -o expressionAlternation of primaries; the OR operator.The second expression shall not be evaluatedif the first expression is true.Both documents say,If no expression is present, -print shall be used as the expression.---------------- TL;DR ----------------So,find -type dis equivalent tofind -type d -printwhich is equivalent tofind -type d -a -printwhich means,for each file,evaluate the -type d test.If it is true (i.e., if the current file is a directory),evaluate (perform) the -print action.Whereas,find -print -type dis equivalent tofind -print -a -type dwhich means,for each file,evaluate (perform) the -print action(i.e., this happens for all files).If it is true (which -print always is), evaluate the -type d test.And, since thats the end of the command,the result of the -type d test is ignored.So there you have it.