Introduce new --printf option with lfs find utility along with
support for the backslash escapes and format directives given
below that allow users to obtain metadata in formatted style.
List of backslash escapes supported by --printf option:
-------------------------------------
Description | Escape
-------------------------------------
Newline character | \n
Tab character | \t
Literal backslash | \\
List of format directives used with --printf option:
----------------------------------------------------------
Description | Directive
----------------------------------------------------------
Literal % character | %%
Access time (in ctime format) | %a
Access time (in secs since epoch) | %A@
File size (in 512B blocks) | %b
Last change time (in ctime format) | %c
Last change time (in secs since epoch) | %C@
Numeric group ID of file/dir owner | %G
File size (in 1K blocks) | %k
File mode (octal) | %m
Path name of file | %p
File size (in bytes) | %s
Modification time (in ctime format) | %t
Modification time (in secs since epoch) | %T@
Numeric user ID of file/dir owner | %U
Birth time (in ctime format) | %w
Birth time (in secs since epoch) | %W@
File type | %y
Stripe count | %Lc
Lustre FID | %LF
Directory hash type | %Lh
Starting OST (file) or MDT (dir) index | %Li
List of all OST (file) or MDT (dir) indices | %Lo
OST pool name | %Lp
Numeric project id assigned to file/dir | %LP
Stripe size in bytes | %LS
---------------------------------------------------------
Note: Stripe size and OST pool name are not defined for
directories whereas Hash type is not defined for files.
%Li gives starting OST index for files and starting MDT index
for directories. For composite files %Lo provides list of all
OST indices for all components whereas %Lc, %LS, %Li and %Lp
provide details for last initialized component only.
A usage example for --printf option and its output for a composite
file with three components are shown below.