The
find utility syntax is a superset of the syntax specified by the IEEE Std 1003.2 (“POSIX.2”) standard.
The options and the
-amin,
-anewer,
-cmin,
-cnewer,
-delete,
-empty,
-execdir,
-follow,
-fstype,
-iname,
-inum,
-iregex,
-links,
-ls,
-maxdepth,
-mindepth,
-mmin,
-path,
-print0,
-printx,
-regex, and
-rm primaries are extensions to IEEE Std 1003.2 (“POSIX.2”).
Historically, the
-d,
-h, and
-x options were implemented using the primaries “-depth”, “-follow”, and “-xdev”. These primaries always evaluated to true. As they were really global variables that took effect before the traversal began, some legal expressions could have unexpected results. An example is the expression “-print -o -depth”. As -print always evaluates to true, the standard order of evaluation implies that -depth would never be evaluated. This is not the case.
The operator “-or” was implemented as “-o”, and the operator “-and” was implemented as “-a”.
Historic implementations of the
-exec and
-ok primaries did not replace the string “{}” in the utility name or the utility arguments if it had preceding or following non-whitespace characters. This version replaces it no matter where in the utility name or arguments it appears.
Support for “
-exec ... +” is consistent with
IEEE PASC Interpretation 1003.2 #210, though the feature originated in SVR4.
The
-delete primary does not interact well with other options that cause the file system tree traversal options to be changed.