Home Explore Blog CI



man-pages

15th chunk of `find.man`
176e435e6aef1cd8c79dac64a213445695f9fe4488b6d1630000000100000fcc
 FILENAMES section for information about how unusual characters in
              filenames are handled.

       -ls    True; list current file in ls -dils format on standard output.  The block counts are of 1 KB blocks, unless the environment variable POSIXLY_CORRECT is set, in which case 512‐byte blocks are used.  See the  UN‐
              USUAL FILENAMES section for information about how unusual characters in filenames are handled.

       -ok command ;
              Like  -exec but ask the user first.  If the user agrees, run the command.  Otherwise just return false.  If the command is run, its standard input is redirected from /dev/null.  This action may not be specified
              together with the -files0-from option.

              The response to the prompt is matched against a pair of regular expressions to determine if it is an affirmative or negative response.  This regular expression is obtained from the system if the POSIXLY_CORRECT
              environment variable is set, or otherwise from find’s message translations.  If the system has no suitable definition, find’s own definition will be used.  In either case, the interpretation of the regular  ex‐
              pression itself will be affected by the environment variables LC_CTYPE (character classes) and LC_COLLATE (character ranges and equivalence classes).

       -okdir command ;
              Like  -execdir but ask the user first in the same way as for -ok.  If the user does not agree, just return false.  If the command is run, its standard input is redirected from /dev/null.  This action may not be
              specified together with the -files0-from option.

       -print True; print the full file name on the standard output, followed by a newline.  If you are piping the output of find into another program and there is the faintest  possibility  that  the  files  which  you  are
              searching for might contain a newline, then you should seriously consider using the -print0 option instead of -print.  See the UNUSUAL FILENAMES section for information about how unusual characters in filenames
              are handled.

       -print0
              True;  print  the  full  file name on the standard output, followed by a null character (instead of the newline character that -print uses).  This allows file names that contain newlines or other types of white
              space to be correctly interpreted by programs that process the find output.  This option corresponds to the -0 option of xargs.

       -printf format
              True; print format on the standard output, interpreting ‘\’ escapes and ‘%’ directives.  Field widths and precisions can be specified as with the printf(3) C function.  Please note that many of the  fields  are
              printed  as  %s  rather than %d, and this may mean that flags don’t work as you might expect.  This also means that the ‘-’ flag does work (it forces fields to be left‐aligned).  Unlike -print, -printf does not
              add a newline at the end of the string.  The escapes and directives are:

              \a     Alarm bell.

              \b     Backspace.

              \c     Stop printing from this format immediately and flush the output.

              \f     Form feed.

              \n     Newline.

              \r     Carriage return.

              \t     Horizontal tab.

              \v     Vertical tab.

              \0     ASCII NUL.

              \\     A literal backslash (‘\’).

              \NNN   The character whose ASCII code is NNN (octal).

              A ‘\’ character followed by any other character is treated as an ordinary character, so they both are printed.

              %%     A literal percent sign.

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

              %Ak    File’s last access time in the format specified by k, which is either ‘@’ or a directive for the C strftime(3) function.  The following shows

Title: find Actions (continued): -ok, -okdir, -print, -print0, -printf
Summary
This section describes the `-ok` and `-okdir` actions, which are similar to `-exec` and `-execdir` but prompt the user for confirmation before executing a command. It also covers the `-print` and `-print0` actions, which print the full file name to standard output, with `-print0` using a null character as a separator for handling filenames with newlines. Finally, it explains the `-printf` action, which allows printing formatted output with escape sequences and directives similar to the C `printf` function.