Home Explore Blog CI



man-pages

7th chunk of `find.man`
edb336038bf0640509a4a9d0f1e838dae71ad09d9ec31bb70000000100000fc6
             Normally, find will emit an error message when it fails to stat a file.  If you give this option and a file is deleted between the time find reads the name of the file from the directory and the time  it  tries
              to  stat  the  file,  no error message will be issued.  This also applies to files or directories whose names are given on the command line.  This option takes effect at the time the command line is read, which
              means that you cannot search one part of the filesystem with this option on and part of it with this option off (if you need to do that, you will need to issue two find commands instead, one with the option and
              one without it).

              Furthermore, find with the -ignore_readdir_race option will ignore errors of the -delete action in the case the file has disappeared since the parent directory was read: it will not output an error  diagnostic,
              and the return code of the -delete action will be true.

       -maxdepth levels
              Descend at most levels (a non‐negative integer) levels of directories below the starting‐points.  Using -maxdepth 0 means only apply the tests and actions to the starting‐points themselves.

       -mindepth levels
              Do not apply any tests or actions at levels less than levels (a non‐negative integer).  Using -mindepth 1 means process all files except the starting‐points.

       -mount Don’t descend directories on other filesystems.  An alternate name for -xdev, for compatibility with some other versions of find.

       -noignore_readdir_race
              Turns off the effect of -ignore_readdir_race.

       -noleaf
              Do  not  optimize by assuming that directories contain 2 fewer subdirectories than their hard link count.  This option is needed when searching filesystems that do not follow the Unix directory‐link convention,
              such as CD‐ROM or MS‐DOS filesystems or AFS volume mount points.  Each directory on a normal Unix filesystem has at least 2 hard links: its name and its ‘.’ entry.  Additionally,  its  subdirectories  (if  any)
              each  have  a  ‘..’ entry linked to that directory.  When find is examining a directory, after it has statted 2 fewer subdirectories than the directory’s link count, it knows that the rest of the entries in the
              directory are non‐directories (‘leaf’ files in the directory tree).  If only the files’ names need to be examined, there is no need to stat them; this gives a significant increase in search speed.

       -version, --version
              Print the find version number and exit.

       -xdev  Don’t descend directories on other filesystems.

   TESTS
       Some tests, for example -newerXY and -samefile, allow comparison between the file currently being examined and some reference file specified on the command line.  When these tests are used, the interpretation  of  the
       reference  file is determined by the options -H, -L and -P and any previous -follow, but the reference file is only examined once, at the time the command line is parsed.  If the reference file cannot be examined (for
       example, the stat(2) system call fails for it), an error message is issued, and find exits with a nonzero status.

       A numeric argument n can be specified to tests (like -amin, -mtime, -gid, -inum, -links, -size, -uid and -used) as

       +n     for greater than n,

       -n     for less than n,

       n      for exactly n.

       Supported tests:

       -amin n
              File was last accessed less than, more than or exactly n minutes ago.

       -anewer reference
              Time of the last access of the current file is more recent than that of the last data modification of the reference file.  If reference is a symbolic link and the -H option or the -L option is in  effect,  then
              the time of the last data modification of the file it points to is always used.

       -atime n
  

Title: find Global Options Continued: -maxdepth, -mindepth, -mount, -noignore_readdir_race, -noleaf, -version, -xdev and Tests Introduction
Summary
This section continues the explanation of `find` global options. It covers `-maxdepth` and `-mindepth` to control directory descent depth, `-mount` and `-xdev` to restrict searches to the same filesystem, `-noignore_readdir_race` to revert the effect of `-ignore_readdir_race`, `-noleaf` to disable optimization for non-Unix filesystems, and `-version` to display the version number. It also introduces the concept of tests and how numeric arguments are specified for them. Finally, it starts listing supported tests, beginning with `-amin` and `-anewer`.