FIND(1)                    POSIX Programmer's Manual                   FIND(1)



PPRROOLLOOGG
       This manual page is part of the POSIX Programmer's Manual.  The OS
       implementation of this interface may differ (consult the corresponding
       OS manual page for details of OS behavior), or the interface may not be
       implemented on OS.

NNAAMMEE
       find -- find files

SSYYNNOOPPSSIISS
       find [[-H|-L]] _p_a_t_h... [[_o_p_e_r_a_n_d___e_x_p_r_e_s_s_i_o_n...]]

DDEESSCCRRIIPPTTIIOONN
       The _f_i_n_d utility shall recursively descend the directory hierarchy from
       each file specified by _p_a_t_h, evaluating a Boolean expression composed
       of the primaries described in the OPERANDS section for each file
       encountered. Each _p_a_t_h operand shall be evaluated unaltered as it was
       provided, including all trailing <slash> characters; all pathnames for
       other files encountered in the hierarchy shall consist of the
       concatenation of the current _p_a_t_h operand, a <slash> if the current
       _p_a_t_h operand did not end in one, and the filename relative to the _p_a_t_h
       operand. The relative portion shall contain no dot or dot-dot
       components, no trailing <slash> characters, and only single <slash>
       characters between pathname components.

       The _f_i_n_d utility shall be able to descend to arbitrary depths in a file
       hierarchy and shall not fail due to path length limitations (unless a
       _p_a_t_h operand specified by the application exceeds {PATH_MAX}
       requirements).

       The _f_i_n_d utility shall detect infinite loops; that is, entering a
       previously visited directory that is an ancestor of the last file
       encountered.  When it detects an infinite loop, _f_i_n_d shall write a
       diagnostic message to standard error and shall either recover its
       position in the hierarchy or terminate.

       If a file is removed from or added to the directory hierarchy being
       searched it is unspecified whether or not _f_i_n_d includes that file in
       its search.

OOPPTTIIOONNSS
       The _f_i_n_d utility shall conform to the Base Definitions volume of
       POSIX.1-2017, _S_e_c_t_i_o_n _1_2_._2, _U_t_i_l_i_t_y _S_y_n_t_a_x _G_u_i_d_e_l_i_n_e_s.

       The following options shall be supported by the implementation:

       --HH        Cause the file information and file type evaluated for each
                 symbolic link encountered as a _p_a_t_h operand on the command
                 line to be those of the file referenced by the link, and not
                 the link itself. If the referenced file does not exist, the
                 file information and type shall be for the link itself. File
                 information and type for symbolic links encountered during
                 the traversal of a file hierarchy shall be that of the link
                 itself.

       --LL        Cause the file information and file type evaluated for each
                 symbolic link encountered as a _p_a_t_h operand on the command
                 line or encountered during the traversal of a file hierarchy
                 to be those of the file referenced by the link, and not the
                 link itself. If the referenced file does not exist, the file
                 information and type shall be for the link itself.

       Specifying more than one of the mutually-exclusive options --HH and --LL
       shall not be considered an error. The last option specified shall
       determine the behavior of the utility. If neither the --HH nor the --LL
       option is specified, then the file information and type for symbolic
       links encountered as a _p_a_t_h operand on the command line or encountered
       during the traversal of a file hierarchy shall be that of the link
       itself.

OOPPEERRAANNDDSS
       The following operands shall be supported:

       The first operand and subsequent operands up to but not including the
       first operand that starts with a ''--'', or is a ''!!''  or a ''(('', shall be
       interpreted as _p_a_t_h operands. If the first operand starts with a ''--'',
       or is a ''!!''  or a ''(('', the behavior is unspecified. Each _p_a_t_h operand
       is a pathname of a starting point in the file hierarchy.

       The first operand that starts with a ''--'', or is a ''!!''  or a ''(('', and
       all subsequent arguments shall be interpreted as an _e_x_p_r_e_s_s_i_o_n made up
       of the following primaries and operators. In the descriptions, wherever
       _n is used as a primary argument, it shall be interpreted as a decimal
       integer optionally preceded by a <plus-sign> (''++'') or <hyphen-minus>
       (''--''), as follows:

       +_n        More than _n.

       _n         Exactly _n.

       -_n        Less than _n.

       The following primaries shall be supported:

       --nnaammee _p_a_t_t_e_r_n
                 The primary shall evaluate as true if the basename of the
                 current pathname matches _p_a_t_t_e_r_n using the pattern matching
                 notation described in _S_e_c_t_i_o_n _2_._1_3, _P_a_t_t_e_r_n _M_a_t_c_h_i_n_g
                 _N_o_t_a_t_i_o_n.  The additional rules in _S_e_c_t_i_o_n _2_._1_3_._3, _P_a_t_t_e_r_n_s
                 _U_s_e_d _f_o_r _F_i_l_e_n_a_m_e _E_x_p_a_n_s_i_o_n do not apply as this is a
                 matching operation, not an expansion.

       --ppaatthh _p_a_t_t_e_r_n
                 The primary shall evaluate as true if the current pathname
                 matches _p_a_t_t_e_r_n using the pattern matching notation described
                 in _S_e_c_t_i_o_n _2_._1_3, _P_a_t_t_e_r_n _M_a_t_c_h_i_n_g _N_o_t_a_t_i_o_n.  The additional
                 rules in _S_e_c_t_i_o_n _2_._1_3_._3, _P_a_t_t_e_r_n_s _U_s_e_d _f_o_r _F_i_l_e_n_a_m_e _E_x_p_a_n_s_i_o_n
                 do not apply as this is a matching operation, not an
                 expansion.

       --nnoouusseerr   The primary shall evaluate as true if the file belongs to a
                 user ID for which the _g_e_t_p_w_u_i_d() function defined in the
                 System Interfaces volume of POSIX.1-2017 (or equivalent)
                 returns NULL.

       --nnooggrroouupp  The primary shall evaluate as true if the file belongs to a
                 group ID for which the _g_e_t_g_r_g_i_d() function defined in the
                 System Interfaces volume of POSIX.1-2017 (or equivalent)
                 returns NULL.

       --xxddeevv     The primary shall always evaluate as true; it shall cause
                 _f_i_n_d not to continue descending past directories that have a
                 different device ID (_s_t___d_e_v, see the _s_t_a_t() function defined
                 in the System Interfaces volume of POSIX.1-2017). If any
                 --xxddeevv primary is specified, it shall apply to the entire
                 expression even if the --xxddeevv primary would not normally be
                 evaluated.

       --pprruunnee    The primary shall always evaluate as true; it shall cause
                 _f_i_n_d not to descend the current pathname if it is a
                 directory. If the --ddeepptthh primary is specified, the --pprruunnee
                 primary shall have no effect.

       --ppeerrmm [[--]]_m_o_d_e
                 The _m_o_d_e argument is used to represent file mode bits. It
                 shall be identical in format to the _s_y_m_b_o_l_i_c___m_o_d_e operand
                 described in _c_h_m_o_d, and shall be interpreted as follows. To
                 start, a template shall be assumed with all file mode bits
                 cleared. An _o_p symbol of ''++'' shall set the appropriate mode
                 bits in the template; ''--'' shall clear the appropriate bits;
                 ''=='' shall set the appropriate mode bits, without regard to
                 the contents of the file mode creation mask of the process.
                 The _o_p symbol of ''--'' cannot be the first character of _m_o_d_e;
                 this avoids ambiguity with the optional leading <hyphen-
                 minus>.  Since the initial mode is all bits off, there are
                 not any symbolic modes that need to use ''--'' as the first
                 character.

                 If the <hyphen-minus> is omitted, the primary shall evaluate
                 as true when the file permission bits exactly match the value
                 of the resulting template.

                 Otherwise, if _m_o_d_e is prefixed by a <hyphen-minus>, the
                 primary shall evaluate as true if at least all the bits in
                 the resulting template are set in the file permission bits.

       --ppeerrmm [[--]]_o_n_u_m
                 If the <hyphen-minus> is omitted, the primary shall evaluate
                 as true when the file mode bits exactly match the value of
                 the octal number _o_n_u_m (see the description of the octal _m_o_d_e
                 in _c_h_m_o_d).  Otherwise, if _o_n_u_m is prefixed by a <hyphen-
                 minus>, the primary shall evaluate as true if at least all of
                 the bits specified in _o_n_u_m are set. In both cases, the
                 behavior is unspecified when _o_n_u_m exceeds 07777.

       --ttyyppee _c   The primary shall evaluate as true if the type of the file is
                 _c, where _c is ''bb'', ''cc'', ''dd'', ''ll'', ''pp'', ''ff'', or ''ss'' for block
                 special file, character special file, directory, symbolic
                 link, FIFO, regular file, or socket, respectively.

       --lliinnkkss _n  The primary shall evaluate as true if the file has _n links.

       --uusseerr _u_n_a_m_e
                 The primary shall evaluate as true if the file belongs to the
                 user _u_n_a_m_e_.  If _u_n_a_m_e is a decimal integer and the _g_e_t_p_w_n_a_m()
                 (or equivalent) function does not return a valid user name,
                 _u_n_a_m_e shall be interpreted as a user ID.

       --ggrroouupp _g_n_a_m_e
                 The primary shall evaluate as true if the file belongs to the
                 group _g_n_a_m_e.  If _g_n_a_m_e is a decimal integer and the
                 _g_e_t_g_r_n_a_m() (or equivalent) function does not return a valid
                 group name, _g_n_a_m_e shall be interpreted as a group ID.

       --ssiizzee _n[[cc]]
                 The primary shall evaluate as true if the file size in bytes,
                 divided by 512 and rounded up to the next integer, is _n.  If
                 _n is followed by the character ''cc'', the size shall be in
                 bytes.

       --aattiimmee _n  The primary shall evaluate as true if the file access time
                 subtracted from the initialization time, divided by 86400
                 (with any remainder discarded), is _n.

       --ccttiimmee _n  The primary shall evaluate as true if the time of last change
                 of file status information subtracted from the initialization
                 time, divided by 86400 (with any remainder discarded), is _n.

       --mmttiimmee _n  The primary shall evaluate as true if the file modification
                 time subtracted from the initialization time, divided by
                 86400 (with any remainder discarded), is _n.

       --eexxeecc _u_t_i_l_i_t_y___n_a_m_e [[_a_r_g_u_m_e_n_t ...]] ;;

       --eexxeecc _u_t_i_l_i_t_y___n_a_m_e [[_a_r_g_u_m_e_n_t ...]]  {} +
                 The end of the primary expression shall be punctuated by a
                 <semicolon> or by a <plus-sign>.  Only a <plus-sign> that
                 immediately follows an argument containing only the two
                 characters ""{{}}"" shall punctuate the end of the primary
                 expression. Other uses of the <plus-sign> shall not be
                 treated as special.

                 If the primary expression is punctuated by a <semicolon>, the
                 utility _u_t_i_l_i_t_y___n_a_m_e shall be invoked once for each pathname
                 and the primary shall evaluate as true if the utility returns
                 a zero value as exit status. A _u_t_i_l_i_t_y___n_a_m_e or _a_r_g_u_m_e_n_t
                 containing only the two characters ""{{}}"" shall be replaced by
                 the current pathname. If a _u_t_i_l_i_t_y___n_a_m_e or _a_r_g_u_m_e_n_t string
                 contains the two characters ""{{}}"", but not just the two
                 characters ""{{}}"", it is implementation-defined whether _f_i_n_d
                 replaces those two characters or uses the string without
                 change.

                 If the primary expression is punctuated by a <plus-sign>, the
                 primary shall always evaluate as true, and the pathnames for
                 which the primary is evaluated shall be aggregated into sets.
                 The utility _u_t_i_l_i_t_y___n_a_m_e shall be invoked once for each set
                 of aggregated pathnames. Each invocation shall begin after
                 the last pathname in the set is aggregated, and shall be
                 completed before the _f_i_n_d utility exits and before the first
                 pathname in the next set (if any) is aggregated for this
                 primary, but it is otherwise unspecified whether the
                 invocation occurs before, during, or after the evaluations of
                 other primaries. If any invocation returns a non-zero value
                 as exit status, the _f_i_n_d utility shall return a non-zero exit
                 status. An argument containing only the two characters ""{{}}""
                 shall be replaced by the set of aggregated pathnames, with
                 each pathname passed as a separate argument to the invoked
                 utility in the same order that it was aggregated. The size of
                 any set of two or more pathnames shall be limited such that
                 execution of the utility does not cause the system's
                 {ARG_MAX} limit to be exceeded. If more than one argument
                 containing the two characters ""{{}}"" is present, the behavior
                 is unspecified.

                 The current directory for the invocation of _u_t_i_l_i_t_y___n_a_m_e
                 shall be the same as the current directory when the _f_i_n_d
                 utility was started. If the _u_t_i_l_i_t_y___n_a_m_e names any of the
                 special built-in utilities (see _S_e_c_t_i_o_n _2_._1_4, _S_p_e_c_i_a_l _B_u_i_l_t_-
                 _I_n _U_t_i_l_i_t_i_e_s), the results are undefined.

       --ookk _u_t_i_l_i_t_y___n_a_m_e [[_a_r_g_u_m_e_n_t ...]] ;;
                 The --ookk primary shall be equivalent to --eexxeecc, except that the
                 use of a <plus-sign> to punctuate the end of the primary
                 expression need not be supported, and _f_i_n_d shall request
                 affirmation of the invocation of _u_t_i_l_i_t_y___n_a_m_e using the
                 current file as an argument by writing to standard error as
                 described in the STDERR section. If the response on standard
                 input is affirmative, the utility shall be invoked.
                 Otherwise, the command shall not be invoked and the value of
                 the --ookk operand shall be false.

       --pprriinntt    The primary shall always evaluate as true; it shall cause the
                 current pathname to be written to standard output.

       --nneewweerr _f_i_l_e
                 The primary shall evaluate as true if the modification time
                 of the current file is more recent than the modification time
                 of the file named by the pathname _f_i_l_e.

       --ddeepptthh    The primary shall always evaluate as true; it shall cause
                 descent of the directory hierarchy to be done so that all
                 entries in a directory are acted on before the directory
                 itself. If a --ddeepptthh primary is not specified, all entries in
                 a directory shall be acted on after the directory itself. If
                 any --ddeepptthh primary is specified, it shall apply to the entire
                 expression even if the --ddeepptthh primary would not normally be
                 evaluated.

       The primaries can be combined using the following operators (in order
       of decreasing precedence):

       ( _e_x_p_r_e_s_s_i_o_n )
                 True if _e_x_p_r_e_s_s_i_o_n is true.

       !! _e_x_p_r_e_s_s_i_o_n
                 Negation of a primary; the unary NOT operator.

       _e_x_p_r_e_s_s_i_o_n [[--aa]] _e_x_p_r_e_s_s_i_o_n
                 Conjunction of primaries; the AND operator is implied by the
                 juxtaposition of two primaries or made explicit by the
                 optional --aa operator. The second expression shall not be
                 evaluated if the first expression is false.

       _e_x_p_r_e_s_s_i_o_n --oo _e_x_p_r_e_s_s_i_o_n
                 Alternation of primaries; the OR operator. The second
                 expression shall not be evaluated if the first expression is
                 true.

       If no _e_x_p_r_e_s_s_i_o_n is present, --pprriinntt shall be used as the expression.
       Otherwise, if the given expression does not contain any of the
       primaries --eexxeecc, --ookk, or --pprriinntt, the given expression shall be
       effectively replaced by:


           ( _g_i_v_e_n___e_x_p_r_e_s_s_i_o_n ) -print

       The --uusseerr, --ggrroouupp, and --nneewweerr primaries each shall evaluate their
       respective arguments only once.

       When the file type evaluated for the current file is a symbolic link,
       the results of evaluating the --ppeerrmm primary are implementation-defined.

SSTTDDIINN
       If the --ookk primary is used, the response shall be read from the
       standard input.  An entire line shall be read as the response.
       Otherwise, the standard input shall not be used.

IINNPPUUTT FFIILLEESS
       None.

EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS
       The following environment variables shall affect the execution of _f_i_n_d:

       _L_A_N_G      Provide a default value for the internationalization
                 variables that are unset or null. (See the Base Definitions
                 volume of POSIX.1-2017, _S_e_c_t_i_o_n _8_._2, _I_n_t_e_r_n_a_t_i_o_n_a_l_i_z_a_t_i_o_n
                 _V_a_r_i_a_b_l_e_s for the precedence of internationalization
                 variables used to determine the values of locale categories.)

       _L_C___A_L_L    If set to a non-empty string value, override the values of
                 all the other internationalization variables.

       _L_C___C_O_L_L_A_T_E
                 Determine the locale for the behavior of ranges, equivalence
                 classes, and multi-character collating elements used in the
                 pattern matching notation for the --nn option and in the
                 extended regular expression defined for the yyeesseexxpprr locale
                 keyword in the _L_C___M_E_S_S_A_G_E_S category.

       _L_C___C_T_Y_P_E  This variable determines the locale for the interpretation of
                 sequences of bytes of text data as characters (for example,
                 single-byte as opposed to multi-byte characters in
                 arguments), the behavior of character classes within the
                 pattern matching notation used for the --nn option, and the
                 behavior of character classes within regular expressions used
                 in the extended regular expression defined for the yyeesseexxpprr
                 locale keyword in the _L_C___M_E_S_S_A_G_E_S category.

       _L_C___M_E_S_S_A_G_E_S
                 Determine the locale used to process affirmative responses,
                 and the locale used to affect the format and contents of
                 diagnostic messages and prompts written to standard error.

       _N_L_S_P_A_T_H   Determine the location of message catalogs for the processing
                 of _L_C___M_E_S_S_A_G_E_S.

       _P_A_T_H      Determine the location of the _u_t_i_l_i_t_y___n_a_m_e for the --eexxeecc and
                 --ookk primaries, as described in the Base Definitions volume of
                 POSIX.1-2017, _C_h_a_p_t_e_r _8, _E_n_v_i_r_o_n_m_e_n_t _V_a_r_i_a_b_l_e_s.

AASSYYNNCCHHRROONNOOUUSS EEVVEENNTTSS
       Default.

SSTTDDOOUUTT
       The --pprriinntt primary shall cause the current pathnames to be written to
       standard output. The format shall be:


           "%s\n", <_p_a_t_h>

SSTTDDEERRRR
       The --ookk primary shall write a prompt to standard error containing at
       least the _u_t_i_l_i_t_y___n_a_m_e to be invoked and the current pathname. In the
       POSIX locale, the last non-<blank> in the prompt shall be ''??''.  The
       exact format used is unspecified.

       Otherwise, the standard error shall be used only for diagnostic
       messages.

OOUUTTPPUUTT FFIILLEESS
       None.

EEXXTTEENNDDEEDD DDEESSCCRRIIPPTTIIOONN
       None.

EEXXIITT SSTTAATTUUSS
       The following exit values shall be returned:

        0    All _p_a_t_h operands were traversed successfully.

       >0    An error occurred.

CCOONNSSEEQQUUEENNCCEESS OOFF EERRRROORRSS
       Default.

       _T_h_e _f_o_l_l_o_w_i_n_g _s_e_c_t_i_o_n_s _a_r_e _i_n_f_o_r_m_a_t_i_v_e_.

AAPPPPLLIICCAATTIIOONN UUSSAAGGEE
       When used in operands, pattern matching notation, <semicolon>, <left-
       parenthesis>, and <right-parenthesis> characters are special to the
       shell and must be quoted (see _S_e_c_t_i_o_n _2_._2, _Q_u_o_t_i_n_g).

       The bit that is traditionally used for sticky (historically 01000) is
       specified in the --ppeerrmm primary using the octal number argument form.
       Since this bit is not defined by this volume of POSIX.1-2017,
       applications must not assume that it actually refers to the traditional
       sticky bit.

EEXXAAMMPPLLEESS
        1. The following commands are equivalent:


               find .
               find . -print

           They both write out the entire directory hierarchy from the current
           directory.

        2. The following command:


               find / \( -name tmp -o -name '*.xx' \) -atime +7 -exec rm {} \;

           removes all files named ttmmpp or ending in ..xxxx that have not been
           accessed for seven or more 24-hour periods.

        3. The following command:


               find . -perm -o+w,+s

           prints (--pprriinntt is assumed) the names of all files in or below the
           current directory, with all of the file permission bits S_ISUID,
           S_ISGID, and S_IWOTH set.

        4. The following command:


               find . -name SCCS -prune -o -print

           recursively prints pathnames of all files in the current directory
           and below, but skips directories named SCCS and files in them.

        5. The following command:


               find . -print -name SCCS -prune

           behaves as in the previous example, but prints the names of the
           SCCS directories.

        6. The following command is roughly equivalent to the --nntt extension to
           _t_e_s_t:


               if [ -n "$(find file1 -prune -newer file2)" ]; then
                   printf %s\\n "file1 is newer than file2"
               fi

        7. The descriptions of --aattiimmee, --ccttiimmee, and --mmttiimmee use the terminology
           _n ``86400 second periods (days)''. For example, a file accessed at
           23:59 is selected by:


               find . -atime -1 -print

           at 00:01 the next day (less than 24 hours later, not more than one
           day ago); the midnight boundary between days has no effect on the
           24-hour calculation.

        8. The following command:


               find . ! -name . -prune -name '*.old' -exec \
                   sh -c 'mv "$@" ../old/' sh {} +

           performs the same task as:


               mv ./*.old ./.old ./.*.old ../old/

           while avoiding an ``Argument list too long'' error if there are a
           large number of files ending with ..oolldd and without running _m_v if
           there are no such files (and avoiding ``No such file or directory''
           errors if ..//..oolldd does not exist or no files match ..//**..oolldd or
           ..//..**..oolldd).

           The alternative:


               find . ! -name . -prune -name '*.old' -exec mv {} ../old/ \;

           is less efficient if there are many files to move because it
           executes one _m_v command per file.

        9. On systems configured to mount removable media on directories under
           //mmeeddiiaa, the following command searches the file hierarchy for files
           larger than 100000 KB without searching any mounted removable
           media:


               find / -path /media -prune -o -size +200000 -print

       10. Except for the root directory, and ""////"" on implementations where
           ""////"" does not refer to the root directory, no pattern given to
           --nnaammee will match a <slash>, because trailing <slash> characters are
           ignored when computing the basename of the file under evaluation.
           Given two empty directories named ffoooo and bbaarr, the following
           command:


               find foo/// bar/// -name foo -o -name 'bar?*'

           prints only the line ""ffoooo//////"".

RRAATTIIOONNAALLEE
       The --aa operator was retained as an optional operator for compatibility
       with historical shell scripts, even though it is redundant with
       expression concatenation.

       The descriptions of the ''--'' modifier on the _m_o_d_e and _o_n_u_m arguments to
       the --ppeerrmm primary agree with historical practice on BSD and System V
       implementations. System V and BSD documentation both describe it in
       terms of checking additional bits; in fact, it uses the same bits, but
       checks for having at least all of the matching bits set instead of
       having exactly the matching bits set.

       The exact format of the interactive prompts is unspecified. Only the
       general nature of the contents of prompts are specified because:

        *  Implementations may desire more descriptive prompts than those used
           on historical implementations.

        *  Since the historical prompt strings do not terminate with <newline>
           characters, there is no portable way for another program to
           interact with the prompts of this utility via pipes.

       Therefore, an application using this prompting option relies on the
       system to provide the most suitable dialog directly with the user,
       based on the general guidelines specified.

       The --nnaammee _f_i_l_e operand was changed to use the shell pattern matching
       notation so that _f_i_n_d is consistent with other utilities using pattern
       matching.

       The --ssiizzee operand refers to the size of a file, rather than the number
       of blocks it may occupy in the file system. The intent is that the
       _s_t___s_i_z_e field defined in the System Interfaces volume of POSIX.1-2017
       should be used, not the _s_t___b_l_o_c_k_s found in historical implementations.
       There are at least two reasons for this:

        1. In both System V and BSD, _f_i_n_d only uses _s_t___s_i_z_e in size
           calculations for the operands specified by this volume of
           POSIX.1-2017. (BSD uses _s_t___b_l_o_c_k_s only when processing the --llss
           primary.)

        2. Users usually think of file size in terms of bytes, which is also
           the unit used by the _l_s utility for the output from the --ll option.
           (In both System V and BSD, _l_s uses _s_t___s_i_z_e for the --ll option size
           field and uses _s_t___b_l_o_c_k_s for the _l_s --ss calculations. This volume of
           POSIX.1-2017 does not specify _l_s --ss.)

       The descriptions of --aattiimmee, --ccttiimmee, and --mmttiimmee were changed from the
       SVID description of _n ``days'' to _n being the result of the integer
       division of the time difference in seconds by 86400. The description is
       also different in terms of the exact timeframe for the _n case (_v_e_r_s_u_s
       the _+_n or _-_n), but it matches all known historical implementations. It
       refers to one 86400 second period in the past, not any time from the
       beginning of that period to the current time. For example, --aattiimmee 2 is
       true if the file was accessed any time in the period from 72 hours to
       48 hours ago.

       Historical implementations do not modify ""{{}}"" when it appears as a
       substring of an --eexxeecc or --ookk _u_t_i_l_i_t_y___n_a_m_e or argument string. There
       have been numerous user requests for this extension, so this volume of
       POSIX.1-2017 allows the desired behavior. At least one recent
       implementation does support this feature, but encountered several
       problems in managing memory allocation and dealing with multiple
       occurrences of ""{{}}"" in a string while it was being developed, so it is
       not yet required behavior.

       Assuming the presence of --pprriinntt was added to correct a historical
       pitfall that plagues novice users, it is entirely upwards-compatible
       from the historical System V _f_i_n_d utility. In its simplest form (_f_i_n_d
       _d_i_r_e_c_t_o_r_y), it could be confused with the historical BSD fast _f_i_n_d.
       The BSD developers agreed that adding --pprriinntt as a default expression
       was the correct decision and have added the fast _f_i_n_d functionality
       within a new utility called _l_o_c_a_t_e.

       Historically, the --LL option was implemented using the primary --ffoollllooww.
       The --HH and --LL options were added for two reasons. First, they offer a
       finer granularity of control and consistency with other programs that
       walk file hierarchies. Second, the --ffoollllooww primary always evaluated to
       true. As they were historically really global variables that took
       effect before the traversal began, some valid expressions had
       unexpected results. An example is the expression --pprriinntt --oo --ffoollllooww.
       Because --pprriinntt always evaluates to true, the standard order of
       evaluation implies that --ffoollllooww would never be evaluated. This was
       never the case. Historical practice for the --ffoollllooww primary, however,
       is not consistent. Some implementations always follow symbolic links on
       the command line whether --ffoollllooww is specified or not. Others follow
       symbolic links on the command line only if --ffoollllooww is specified. Both
       behaviors are provided by the --HH and --LL options, but scripts using the
       current --ffoollllooww primary would be broken if the --ffoollllooww option is
       specified to work either way.

       Since the --LL option resolves all symbolic links and the --ttyyppee _l primary
       is true for symbolic links that still exist after symbolic links have
       been resolved, the command:


           find -L . -type l

       prints a list of symbolic links reachable from the current directory
       that do not resolve to accessible files.

       A feature of SVR4's _f_i_n_d utility was the --eexxeecc primary's ++ terminator.
       This allowed filenames containing special characters (especially
       <newline> characters) to be grouped together without the problems that
       occur if such filenames are piped to _x_a_r_g_s.  Other implementations have
       added other ways to get around this problem, notably a --pprriinntt00 primary
       that wrote filenames with a null byte terminator. This was considered
       here, but not adopted. Using a null terminator meant that any utility
       that was going to process _f_i_n_d's --pprriinntt00 output had to add a new option
       to parse the null terminators it would now be reading.

       The ""--eexxeecc...{{}}+" syntax adopted was a result of IEEE PASC
       Interpretation 1003.2 #210. It should be noted that this is an
       incompatible change to IEEE Std 1003.2-1992. For example, the following
       command printed all files with a ''--'' after their name if they are
       regular files, and a ''++'' otherwise:


           find / -type f -exec echo {} - ';' -o -exec echo {} + ';'

       The change invalidates usage like this. Even though the previous
       standard stated that this usage would work, in practice many did not
       support it and the standard developers felt it better to now state that
       this was not allowable.

FFUUTTUURREE DDIIRREECCTTIIOONNSS
       None.

SSEEEE AALLSSOO
       _S_e_c_t_i_o_n _2_._2, _Q_u_o_t_i_n_g, _S_e_c_t_i_o_n _2_._1_3, _P_a_t_t_e_r_n _M_a_t_c_h_i_n_g _N_o_t_a_t_i_o_n, _S_e_c_t_i_o_n
       _2_._1_4, _S_p_e_c_i_a_l _B_u_i_l_t_-_I_n _U_t_i_l_i_t_i_e_s, _c_h_m_o_d, _m_v, _p_a_x, _s_h, _t_e_s_t

       The Base Definitions volume of POSIX.1-2017, _C_h_a_p_t_e_r _8, _E_n_v_i_r_o_n_m_e_n_t
       _V_a_r_i_a_b_l_e_s, _S_e_c_t_i_o_n _1_2_._2, _U_t_i_l_i_t_y _S_y_n_t_a_x _G_u_i_d_e_l_i_n_e_s

       The System Interfaces volume of POSIX.1-2017, _f_s_t_a_t_a_t(), _g_e_t_g_r_g_i_d(),
       _g_e_t_p_w_u_i_d()

CCOOPPYYRRIIGGHHTT
       Portions of this text are reprinted and reproduced in electronic form
       from IEEE Std 1003.1-2017, Standard for Information Technology --
       Portable Operating System Interface (POSIX), The Open Group Base
       Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the
       Institute of Electrical and Electronics Engineers, Inc and The Open
       Group.  In the event of any discrepancy between this version and the
       original IEEE and The Open Group Standard, the original IEEE and The
       Open Group Standard is the referee document. The original Standard can
       be obtained online at http://www.opengroup.org/unix/online.html .

       Any typographical or formatting errors that appear in this page are
       most likely to have been introduced during the conversion of the source
       files to man page format. To report such errors, see
       https://www.kernel.org/doc/man-pages/reporting_bugs.html .



IEEE/The Open Group                  2017                              FIND(1)
