mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-02-18 13:21:58 +02:00
doc: factor out --files0-from duplication
* coreutils.texi (wc invocation) [files0fromOption]: New macro. Use it. (du invocation): Use it here, too.
This commit is contained in:
@@ -3074,29 +3074,32 @@ Print only the newline counts.
|
||||
@opindex --max-line-length
|
||||
Print only the maximum line lengths.
|
||||
|
||||
@macro files0fromOption{cmd,withTotalOption}
|
||||
@itemx --files0-from=@var{FILE}
|
||||
@opindex --files0-from=@var{FILE}
|
||||
@cindex including files from @command{du}
|
||||
@cindex including files from @command{\cmd\}
|
||||
Rather than processing files named on the command line, process those
|
||||
named in file @var{FILE}; each name is terminated by a null byte.
|
||||
This is useful when
|
||||
the list of file names is so long that it may exceed a command line
|
||||
This is useful \withTotalOption\
|
||||
when the list of file names is so long that it may exceed a command line
|
||||
length limitation.
|
||||
In such cases, running @command{wc} via @command{xargs} is undesirable
|
||||
because it splits the list into pieces and makes @command{wc} print a
|
||||
In such cases, running @command{\cmd\} via @command{xargs} is undesirable
|
||||
because it splits the list into pieces and makes @command{\cmd\} print a
|
||||
total for each sublist rather than for the entire list.
|
||||
One way to produce a list of null-byte-terminated file names is with @sc{gnu}
|
||||
@command{find}, using its @option{-print0} predicate. For example, to find
|
||||
the length of the longest line in any @file{.c} or @file{.h} file in the
|
||||
current hierarchy, do this:
|
||||
@command{find}, using its @option{-print0} predicate.
|
||||
Do not specify any @var{FILE} on the command line when using this option.
|
||||
@end macro
|
||||
@files0fromOption{wc,}
|
||||
|
||||
For example, to find the length of the longest line in any @file{.c} or
|
||||
@file{.h} file in the current hierarchy, do this:
|
||||
|
||||
@example
|
||||
find . -name '*.[ch]' -print0 |
|
||||
wc -L --files0-from=- | tail -n1
|
||||
@end example
|
||||
|
||||
Do not specify any @var{FILE} on the command line when using this option.
|
||||
|
||||
@end table
|
||||
|
||||
@exitstatus
|
||||
@@ -9754,20 +9757,7 @@ Does not affect other symbolic links. This is helpful for finding
|
||||
out the disk usage of directories, such as @file{/usr/tmp}, which
|
||||
are often symbolic links.
|
||||
|
||||
@itemx --files0-from=@var{FILE}
|
||||
@opindex --files0-from=@var{FILE}
|
||||
@cindex including files from @command{du}
|
||||
Rather than processing files named on the command line, process those
|
||||
named in file @var{FILE}; each name is terminated by a null byte.
|
||||
This is useful with the @option{--total} (@option{-c}) option when
|
||||
the list of file names is so long that it may exceed a command line
|
||||
length limitation.
|
||||
In such cases, running @command{du} via @command{xargs} is undesirable
|
||||
because it splits the list into pieces and makes @command{du} print a
|
||||
total for each sublist rather than for the entire list.
|
||||
One way to produce a list of null-byte-terminated file names is with @sc{gnu}
|
||||
@command{find}, using its @option{-print0} predicate.
|
||||
Do not specify any @var{FILE} on the command line when using this option.
|
||||
@files0fromOption{du, with the @option{--total} (@option{-c}) option}
|
||||
|
||||
@optHumanReadable
|
||||
|
||||
|
||||
Reference in New Issue
Block a user