mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-04-21 03:12:48 +02:00
doc: document split's new --filter=CMD option
* doc/coreutils.texi (split invocation): Describe --filter=CMD. * NEWS (New feature): Mention it.
This commit is contained in:
10
NEWS
10
NEWS
@@ -2,6 +2,16 @@ GNU coreutils NEWS -*- outline -*-
|
|||||||
|
|
||||||
* Noteworthy changes in release ?.? (????-??-??) [?]
|
* Noteworthy changes in release ?.? (????-??-??) [?]
|
||||||
|
|
||||||
|
** New features
|
||||||
|
|
||||||
|
split accepts a new --filter=CMD option. With it, split filters output
|
||||||
|
through CMD. CMD may use the $FILE environment variable, which is set to
|
||||||
|
the nominal output file name for each invocation of CMD. For example, to
|
||||||
|
split a file into 3 approximately equal parts, which are then compressed:
|
||||||
|
split -n3 --filter='xz > $FILE.xz' big
|
||||||
|
Note the use of single quotes, not double quotes.
|
||||||
|
That creates files named xaa.xz, xab.xz and xac.xz.
|
||||||
|
|
||||||
|
|
||||||
* Noteworthy changes in release 8.12 (2011-04-26) [stable]
|
* Noteworthy changes in release 8.12 (2011-04-26) [stable]
|
||||||
|
|
||||||
|
|||||||
@@ -2992,8 +2992,8 @@ The program accepts the following options. Also see @ref{Common options}.
|
|||||||
Put @var{lines} lines of @var{input} into each output file.
|
Put @var{lines} lines of @var{input} into each output file.
|
||||||
|
|
||||||
For compatibility @command{split} also supports an obsolete
|
For compatibility @command{split} also supports an obsolete
|
||||||
option syntax @option{-@var{lines}}. New scripts should use @option{-l
|
option syntax @option{-@var{lines}}. New scripts should use
|
||||||
@var{lines}} instead.
|
@option{-l @var{lines}} instead.
|
||||||
|
|
||||||
@item -b @var{size}
|
@item -b @var{size}
|
||||||
@itemx --bytes=@var{size}
|
@itemx --bytes=@var{size}
|
||||||
@@ -3011,6 +3011,25 @@ possible without exceeding @var{size} bytes. Individual lines longer than
|
|||||||
@var{size} bytes are broken into multiple files.
|
@var{size} bytes are broken into multiple files.
|
||||||
@var{size} has the same format as for the @option{--bytes} option.
|
@var{size} has the same format as for the @option{--bytes} option.
|
||||||
|
|
||||||
|
@itemx --filter=@var{command}
|
||||||
|
@opindex --filter
|
||||||
|
With this option, rather than simply writing to each output file,
|
||||||
|
write through a pipe to the specified shell @var{command} for each output file.
|
||||||
|
@var{command} should use the $FILE environment variable, which is set
|
||||||
|
to a different output file name for each invocation of the command.
|
||||||
|
For example, imagine that you have a 1TiB compressed file
|
||||||
|
that, if uncompressed, would be too large to reside on disk,
|
||||||
|
yet you must split it into individually-compressed pieces
|
||||||
|
of a more manageable size.
|
||||||
|
To do that, you might run this command:
|
||||||
|
|
||||||
|
@example
|
||||||
|
xz -dc BIG.xz | split -b200G --filter='xz > $FILE.xz' - big-
|
||||||
|
@end example
|
||||||
|
|
||||||
|
Assuming a 10:1 compression ratio, that would create about fifty 20GiB files
|
||||||
|
with names @file{big-xaa.xz}, @file{big-xab.xz}, @file{big-xac.xz}, etc.
|
||||||
|
|
||||||
@item -n @var{chunks}
|
@item -n @var{chunks}
|
||||||
@itemx --number=@var{chunks}
|
@itemx --number=@var{chunks}
|
||||||
@opindex -n
|
@opindex -n
|
||||||
|
|||||||
Reference in New Issue
Block a user