diff options
author | Pádraig Brady <P@draigBrady.com> | 2016-01-12 13:12:37 +0000 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2016-01-13 11:16:39 +0000 |
commit | a0c5313d60703c480014bfd810bf8f1cf9903299 (patch) | |
tree | 899e19aa1cbac928c4316f99a21ccdead1f63384 /doc/coreutils.texi | |
parent | d506af44befdbeabb027322652d4842314ba07be (diff) | |
download | coreutils-a0c5313d60703c480014bfd810bf8f1cf9903299.tar.xz |
doc: mention the '0#' printf flags with stat %a
* src/stat.c (usage): Mention the '#' and '0' flags are useful with %a.
* doc/coreutils.texi (stat invocation): Likewise. Also give an example
printing unambiguous octal output.
Reported at http://bugs.debian.org/810539
Diffstat (limited to 'doc/coreutils.texi')
-rw-r--r-- | doc/coreutils.texi | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi index f7bdc4274..eb5159a44 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -11738,7 +11738,7 @@ The valid @var{format} directives for files with @option{--format} and @option{--printf} are: @itemize @bullet -@item %a - Access rights in octal +@item %a - Access rights in octal (note @samp{#} and @samp{0} printf flags) @item %A - Access rights in human readable form @item %b - Number of blocks allocated (see @samp{%B}) @item %B - The size in bytes of each block reported by @samp{%b} @@ -11770,6 +11770,11 @@ The valid @var{format} directives for files with @option{--format} and @item %Z - Time of last status change as seconds since Epoch @end itemize +The @samp{%a} format prints the octal mode, and so it is useful +to control the zero padding of the output with the @samp{#} and @samp{0} +printf flags. For example to pad to at least 3 wide while making larger +numbers unambiguously octal, you can use @samp{%#03a}. + The @samp{%t} and @samp{%T} formats operate on the st_rdev member of the stat(2) structure, and are only defined for character and block special files. On some systems or file types, st_rdev may be used to |