The manpage for bash has a section for printf which explains the format stuff. printf formats usually follow the C-style printf() function, so format explanations for the C version usually are correct too.
Code:
printf [-v var] format [arguments]
Write the formatted arguments to the standard output under the
control of the format. The -v option causes the output to be
assigned to the variable var rather than being printed to the
standard output.
The format is a character string which contains three types of
objects: plain characters, which are simply copied to standard
output, character escape sequences, which are converted and
copied to the standard output, and format specifications, each
of which causes printing of the next successive argument. In
addition to the standard printf(1) format specifications, printf
interprets the following extensions:
printf(1) format spec is a reference to the section 1 manpage for "printf"
%s is a string.
%Ns is a string limited to the number specified as 'N', right justified
%-Ns is a string limited to the number specified as 'N', left justified
- The converted value is to be left adjusted on the field bound‐
ary. (The default is right justification.) The converted value
is padded on the right with blanks, rather than on the left with
blanks or zeros. A - overrides a 0 if both are given.
Field width
An optional decimal digit string (with nonzero first digit) specifying
a minimum field width. If the converted value has fewer characters
than the field width, it will be padded with spaces on the left (or
right, if the left-adjustment flag has been given).
Not sure I’d trust du to return blocks.
Bookmarks