Home Explore Blog CI



man-pages

18th chunk of `find.man`
f67472fe7c7bd31b5bb9a84d0bf44386e1311f2ae2e81d270000000100000ff2
     File’s permission bits (in octal).  This option uses the ‘traditional’ numbers which most Unix implementations use, but if your particular implementation uses an unusual  ordering  of  octal  permissions
                     bits,  you will see a difference between the actual value of the file’s mode and the output of %m.  Normally you will want to have a leading zero on this number, and to do this, you should use the # flag
                     (as in, for example, ‘%#m’).

              %M     File’s permissions (in symbolic form, as for ls).  This directive is supported in findutils 4.2.5 and later.

              %n     Number of hard links to file.

              %p     File’s name.

              %P     File’s name with the name of the starting‐point under which it was found removed.

              %s     File’s size in bytes.

              %S     File’s sparseness.  This is calculated as (BLOCKSIZE*st_blocks / st_size).  The exact value you will get for an ordinary file of a certain length is system‐dependent.  However, normally sparse files will
                     have values less than 1.0, and files which use indirect blocks may have a value which is greater than 1.0.  In general the number of blocks used by a file is file system dependent.  The  value  used  for
                     BLOCKSIZE is system‐dependent, but is usually 512 bytes.  If the file size is zero, the value printed is undefined.  On systems which lack support for st_blocks, a file’s sparseness is assumed to be 1.0.

              %t     File’s last modification time in the format returned by the C ctime(3) function.

              %Tk    File’s last modification time in the format specified by k, which is the same as for %A.

              %u     File’s user name, or numeric user ID if the user has no name.

              %U     File’s numeric user ID.

              %y     File’s type (like in ls -l), U=unknown type (shouldn’t happen)

              %Y     File’s type (like %y), plus follow symbolic links: ‘L’=loop, ‘N’=nonexistent, ‘?’ for any other error when determining the type of the target of a symbolic link.

              %Z     (SELinux only) file’s security context.

              %{ %[ %(
                     Reserved for future use.

              A  ‘%’  character  followed by any other character is discarded, but the other character is printed (don’t rely on this, as further format characters may be introduced).  A ‘%’ at the end of the format argument
              causes undefined behaviour since there is no following character.  In some locales, it may hide your door keys, while in others it may remove the final page from the novel you are reading.

              The %m and %d directives support the #, 0 and + flags, but the other directives do not, even if they print numbers.  Numeric directives that do not support these flags include G, U, b, D, k and n.  The ‘-’ for‐
              mat flag is supported and changes the alignment of a field from right‐justified (which is the default) to left‐justified.

              See the UNUSUAL FILENAMES section for information about how unusual characters in filenames are handled.

       -prune True; if the file is a directory, do not descend into it.  If -depth is given, then -prune has no effect.  Because -delete implies -depth, you cannot usefully use -prune and -delete together.  For  example,  to
              skip the directory src/emacs and all files and directories under it, and print the names of the other files found, do something like this:
                  find . -path ./src/emacs -prune -o -print

       -quit  Exit  immediately  (with return value zero if no errors have occurred).  This is different to -prune because -prune only applies to the contents of pruned directories, while -quit simply makes find stop immedi‐
              ately.  No child processes will be left running.  Any command lines which have been built by -exec ... + or -execdir ... + are invoked before

Title: find: -printf Format Directives (File Metadata, Continued) and -prune, -quit
Summary
This section continues the description of the `-printf` format directives for the `find` command, focusing on directives that display file metadata. It covers file sparseness (%S), last modification time (%t, %Tk), user name and ID (%u, %U), file type (%y, %Y), SELinux security context (%Z), reserved characters, flag support for %m and %d, and unusual filename handling. Additionally, it details the `-prune` option for skipping directories and the `-quit` option for immediate termination of the find command.