Home Explore Blog CI



man-pages

22th chunk of `find.man`
cf19bb6aa0abb7d0d8e50fa20ead7b6c3d7dc4b0be35d2c40000000100000fbf
 has been turned off with -noleaf, the directory entry will always be examined and the
       diagnostic  message will be issued where it is appropriate.  Symbolic links cannot be used to create filesystem cycles as such, but if the -L option or the -follow option is in use, a diagnostic message is issued when
       find encounters a loop of symbolic links.  As with loops containing hard links, the leaf optimisation will often mean that find knows that it doesn’t need to call stat() or chdir() on the symbolic link, so this  diag‐
       nostic is frequently not necessary.

       The -d option is supported for compatibility with various BSD systems, but you should use the POSIX‐compliant option -depth instead.

       The POSIXLY_CORRECT environment variable does not affect the behaviour of the -regex or -iregex tests because those tests aren’t specified in the POSIX standard.

ENVIRONMENT VARIABLES
       LANG   Provides a default value for the internationalization variables that are unset or null.

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

       LC_COLLATE
              The  POSIX standard specifies that this variable affects the pattern matching to be used for the -name option.  GNU find uses the fnmatch(3) library function, and so support for LC_COLLATE depends on the system
              library.  This variable also affects the interpretation of the response to -ok; while the LC_MESSAGES variable selects the actual pattern used to interpret the response to -ok, the interpretation of any bracket
              expressions in the pattern will be affected by LC_COLLATE.

       LC_CTYPE
              This variable affects the treatment of character classes used in regular expressions and also with the -name test, if the system’s fnmatch(3) library function supports this.  This variable also affects the  in‐
              terpretation  of  any character classes in the regular expressions used to interpret the response to the prompt issued by -ok.  The LC_CTYPE environment variable will also affect which characters are considered
              to be unprintable when filenames are printed; see the section UNUSUAL FILENAMES.

       LC_MESSAGES
              Determines the locale to be used for internationalised messages.  If the POSIXLY_CORRECT environment variable is set, this also determines the interpretation of the response to the prompt made by  the  -ok  ac‐
              tion.

       NLSPATH
              Determines the location of the internationalisation message catalogues.

       PATH   Affects the directories which are searched to find the executables invoked by -exec, -execdir, -ok and -okdir.

       POSIXLY_CORRECT
              Determines the block size used by -ls and -fls.  If POSIXLY_CORRECT is set, blocks are units of 512 bytes.  Otherwise they are units of 1024 bytes.

              Setting  this  variable  also turns off warning messages (that is, implies -nowarn) by default, because POSIX requires that apart from the output for -ok, all messages printed on stderr are diagnostics and must
              result in a non‐zero exit status.

              When POSIXLY_CORRECT is not set, -perm +zzz is treated just like -perm /zzz if +zzz is not a valid symbolic mode.  When POSIXLY_CORRECT is set, such constructs are treated as an error.

              When POSIXLY_CORRECT is set, the response to the prompt made by the -ok action is interpreted according to the system’s message catalogue, as opposed to according to find’s own message translations.

       TZ     Affects the time zone used for some of the time‐related format directives of -printf and -fprintf.

EXAMPLES
   Simple ‘find|xargs‘ approach
       •      Find files named core in or below the directory /tmp and delete them.

                  $ find /tmp -name core -type f -print | xargs /bin/rm -f

              Note that this will work incorrectly if there are any filenames

Title: Environment Variables Affecting `find` Behavior and Usage Examples
Summary
This section describes the influence of various environment variables such as `LANG`, `LC_ALL`, `LC_COLLATE`, `LC_CTYPE`, `LC_MESSAGES`, `NLSPATH`, `PATH`, `POSIXLY_CORRECT`, and `TZ` on the behavior of the `find` command. It details how these variables impact internationalization, pattern matching, message interpretation, file name handling, block size, warning messages, and time zone settings. It also presents a basic example of using `find` with `xargs` to delete files, noting potential issues with filenames containing spaces or special characters.