True; list the current file in ‘ls -dils’ format on the standard output. The output looks like this:
204744 17 -rw-r--r-- 1 djm staff 17337 Nov 2 1992 ./lwall-quotes
The fields are:
POSIXLY_CORRECTis set, in which case 512-byte blocks are used. See Size, for how to find files based on their size.
True; like ‘-ls’ but write to file like ‘-fprint’ (see Print File Name). The named output file is always created, even if no output is sent to it.
True; print format on the standard output, interpreting ‘\’ escapes and ‘%’ directives (more details in the following sections).
Field widths and precisions can be specified as with the
function. Format flags (like ‘#’ for example) may not work as you
expect because many of the fields, even numeric ones, are printed with
%s. Numeric flags which are affected in this way include ‘G’,
‘U’, ‘b’, ‘D’, ‘k’ and ‘n’. This difference in
behaviour means though that the format flag ‘-’ will work; it
forces left-alignment of the field. Unlike ‘-print’,
‘-printf’ does not add a newline at the end of the string. If you
want a newline at the end of the string, add a ‘\n’.
As an example, an approximate equivalent of ‘-ls’ with
null-terminated filenames can be achieved with this
find -printf "%i %4k %M %3n %-8u %-8g %8s %T+ %p\n->%l\0" | cat
A practical reason for doing this would be to get literal filenames in
the output, instead of ‘-ls’’s backslash-escaped names. (Using
cat here prevents this happening for the ‘%p’ format
specifier; see Unusual Characters in File Names). This format also
outputs a uniform timestamp format.
As for symbolic links, the format above outputs the target of the symbolic link
on a second line, following ‘\n->’. There is nothing following the arrow
for file types other than symbolic links.
Another approach, for complete consistency, would be to
symbolic links into a separate file, so they too can be null-terminated.
True; like ‘-printf’ but write to file like ‘-fprint’ (see Print File Name). The output file is always created, even if no output is ever sent to it.
|• Format Directives|
|• Time Formats|
|• Formatting Flags|