diff options
author | Aaron Burgemeister <dajoker@gmail.com> | 2010-07-15 19:54:49 -0600 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2010-08-27 22:16:10 +0100 |
commit | ddf6fb8686b1ed6a26d5f1c76a642d0fb5fe7ba7 (patch) | |
tree | 27c8712c7d87a57181506c24f2b2ebb58769646c /doc | |
parent | 872f6bb2ba11c61271bf34057a2e950abb3e952e (diff) | |
download | coreutils-ddf6fb8686b1ed6a26d5f1c76a642d0fb5fe7ba7.tar.xz |
stat: add %m to output the mount point for a file
* src/find-mount-point.c: A new file refactoring
find_mount_point() out from df.c
* src/find-mount-point.h: Likewise.
* src/df.c: Use the new find-mount-point module.
* src/stat.c (print_stat): Handle the new %m format.
(find_bind_mount): A new function to
return the bind mount for a file if any.
(out_mount_mount): Print the bind mount for a file, or else
the standard mount point given by the find-mount-point module.
(usage): Document the %m format directive.
* src/Makefile.am: Reference the refactored find-mount-point.c
* po/POTFILES.in: Add find_mount_point.c to the translation list
* doc/coreutils.texi (stat invocation): Document %m,
and how it may differ from the mount point that df outputs.
* test/misc/stat-mount: A new test to correlate mount points
output from df and stat.
* tests/Makefile.am: Reference the new test.
* NEWS: Mention the new feature
* THANKS: Add the author
Signed-off-by: Pádraig Brady <P@draigBrady.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/coreutils.texi | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/doc/coreutils.texi b/doc/coreutils.texi index 7eedec75a..6771da949 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -8487,6 +8487,7 @@ removal is requested. Equivalent to @option{-I}. When removing a hierarchy recursively, skip any directory that is on a file system different from that of the corresponding command line argument. +@cindex bind mount This option is useful when removing a build ``chroot'' hierarchy, which normally contains no valuable data. However, it is not uncommon to bind-mount @file{/home} into such a hierarchy, to make it easier to @@ -10685,6 +10686,7 @@ The valid @var{format} directives for files with @option{--format} and @item %G - Group name of owner @item %h - Number of hard links @item %i - Inode number +@item %m - Mount point (See note below) @item %n - File name @item %N - Quoted file name with dereference if symbolic link @item %o - I/O block size @@ -10701,6 +10703,22 @@ The valid @var{format} directives for files with @option{--format} and @item %Z - Time of last change as seconds since Epoch @end itemize +The mount point printed by @samp{%m} is similar to that output +by @command{df}, except that: +@itemize @bullet +@item +stat does not dereference symlinks by default +(unless @option{-L} is specified) +@item +stat does not search for specified device nodes in the +file system list, instead operating on them directly +@item +@cindex bind mount +stat outputs the alias for a bind mounted file, +rather than its backing device. One can recursively call stat +until there is no change in output, to get the base mount point +@end itemize + When listing file system information (@option{--file-system} (@option{-f})), you must use a different set of @var{format} directives: |