Home Explore Blog CI



man-pages

16th chunk of `find.man`
9b5c2e187dd4093180c1de38b820325861878c7263dab5650000000100000fd4
             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 an incomplete list of possible values for k.  Please refer to
                     the documentation of strftime(3) for the full list.  Some of the conversion specification characters might not be available on all systems, due to differences in the implementation of the strftime(3) li‐
                     brary function.

                     @      seconds since Jan. 1, 1970, 00:00 GMT, with fractional part.

                     Time fields:

                     H      hour (00..23)

                     I      hour (01..12)

                     k      hour ( 0..23)

                     l      hour ( 1..12)

                     M      minute (00..59)

                     p      locale’s AM or PM

                     r      time, 12‐hour (hh:mm:ss [AP]M)

                     S      Second (00.00 .. 61.00).  There is a fractional part.

                     T      time, 24‐hour (hh:mm:ss.xxxxxxxxxx)

                     +      Date and time, separated by ‘+’, for example ‘2004-04-28+22:22:05.0’.  This is a GNU extension.  The time is given in the current timezone (which may be affected  by  setting  the  TZ  environment
                            variable).  The seconds field includes a fractional part.

                     X      locale’s time representation (H:M:S).  The seconds field includes a fractional part.

                     Z      time zone (e.g., EDT), or nothing if no time zone is determinable

                     Date fields:

                     a      locale’s abbreviated weekday name (Sun..Sat)

                     A      locale’s full weekday name, variable length (Sunday..Saturday)

                     b      locale’s abbreviated month name (Jan..Dec)

                     B      locale’s full month name, variable length (January..December)

                     c      locale’s date and time (Sat Nov 04 12:02:33 EST 1989).  The format is the same as for ctime(3) and so to preserve compatibility with that format, there is no fractional part in the seconds field.

                     d      day of month (01..31)

                     D      date (mm/dd/yy)

                     F      date (yyyy‐mm‐dd)

                     h      same as b

                     j      day of year (001..366)

                     m      month (01..12)

                     U      week number of year with Sunday as first day of week (00..53)

                     w      day of week (0..6)

                     W      week number of year with Monday as first day of week (00..53)

                     x      locale’s date representation (mm/dd/yy)

                     y      last two digits of year (00..99)

                     Y      year (1970...)

              %b     The amount of disk space used for this file in 512‐byte blocks.  Since disk space is allocated in multiples of the filesystem block size this is usually greater than %s/512, but it can also be smaller if
                     the file is a sparse file.

          

Title: find: -printf Format Directives (Time, Date, and Size)
Summary
This section details the format directives available for the `-printf` action in the `find` command. It covers the escape sequences (like `\n` for newline, `\t` for tab, etc.) and percent directives for printing file information. The focus is on directives related to file access time (`%a`, `%Ak`), including formatting options for time (`%H`, `%I`, `%M`, etc.) and date (`%a`, `%A`, `%b`, `%B`, etc.). It also describes the `%b` directive for displaying disk space usage in 512-byte blocks.