"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "doc/zutils.texi" between
zutils-1.8.tar.lz and zutils-1.9.tar.lz

About: Zutils is a collection of utilities able to deal with any combination of compressed and non-compressed files transparently. The utilities zcat, zcmp, zdiff, zgrep and ztest supports the compressors bzip2, gzip, lzip and xz.

zutils.texi  (zutils-1.8.tar.lz):zutils.texi  (zutils-1.9.tar.lz)
\input texinfo @c -*-texinfo-*- \input texinfo @c -*-texinfo-*-
@c %**start of header @c %**start of header
@setfilename zutils.info @setfilename zutils.info
@documentencoding ISO-8859-15 @documentencoding ISO-8859-15
@settitle Zutils Manual @settitle Zutils Manual
@finalout @finalout
@c %**end of header @c %**end of header
@set UPDATED 1 January 2019 @set UPDATED 27 June 2020
@set VERSION 1.8 @set VERSION 1.9
@dircategory Data Compression @dircategory Data Compression
@direntry @direntry
* Zutils: (zutils). Utilities dealing with compressed files * Zutils: (zutils). Utilities dealing with compressed files
@end direntry @end direntry
@ifnothtml @ifnothtml
@titlepage @titlepage
@title Zutils @title Zutils
@subtitle Utilities dealing with compressed files @subtitle Utilities dealing with compressed files
skipping to change at line 51 skipping to change at line 51
* Zcmp:: Comparing compressed files byte by byte * Zcmp:: Comparing compressed files byte by byte
* Zdiff:: Comparing compressed files line by line * Zdiff:: Comparing compressed files line by line
* Zgrep:: Searching inside compressed files * Zgrep:: Searching inside compressed files
* Ztest:: Testing the integrity of compressed files * Ztest:: Testing the integrity of compressed files
* Zupdate:: Recompressing files to lzip format * Zupdate:: Recompressing files to lzip format
* Problems:: Reporting bugs * Problems:: Reporting bugs
* Concept index:: Index of concepts * Concept index:: Index of concepts
@end menu @end menu
@sp 1 @sp 1
Copyright @copyright{} 2009-2019 Antonio Diaz Diaz. Copyright @copyright{} 2009-2020 Antonio Diaz Diaz.
This manual is free documentation: you have unlimited permission This manual is free documentation: you have unlimited permission to copy,
to copy, distribute and modify it. distribute, and modify it.
@node Introduction @node Introduction
@chapter Introduction @chapter Introduction
@cindex introduction @cindex introduction
Zutils is a collection of utilities able to process any combination of @uref{http://www.nongnu.org/zutils/zutils.html,,Zutils}
compressed and uncompressed files transparently. If any given file, is a collection of utilities able to process any combination of
including standard input, is compressed, its decompressed content is compressed and uncompressed files transparently. If any file given,
used. Compressed files are decompressed on the fly; no temporary files including standard input, is compressed, its decompressed content is used.
are created. Compressed files are decompressed on the fly; no temporary files are
created.
These utilities are not wrapper scripts but safer and more efficient C++ These utilities are not wrapper scripts but safer and more efficient C++
programs. In particular the @samp{--recursive} option is very efficient programs. In particular the option @samp{--recursive} is very efficient in
in those utilities supporting it. those utilities supporting it.
@noindent @noindent
The utilities provided are zcat, zcmp, zdiff, zgrep, ztest and zupdate.@* The utilities provided are zcat, zcmp, zdiff, zgrep, ztest, and zupdate.@*
The formats supported are bzip2, gzip, lzip and xz.@* The formats supported are bzip2, gzip, lzip, and xz.@*
Zutils uses external compressors. The compressor to be used for each Zutils uses external compressors. The compressor to be used for each format
format is configurable at runtime. is configurable at runtime.
zcat, zcmp, zdiff, and zgrep are improved replacements for the shell zcat, zcmp, zdiff, and zgrep are improved replacements for the shell scripts
scripts provided by GNU gzip. ztest is unique to zutils. zupdate is provided by GNU gzip. ztest is unique to zutils. zupdate is similar to
similar to gzip's znew. gzip's znew.
NOTE: Bzip2 and lzip provide well-defined values of exit status, which NOTE: Bzip2 and lzip provide well-defined values of exit status, which makes
makes them safe to use with zutils. Gzip and xz may return ambiguous them safe to use with zutils. Gzip and xz may return ambiguous warning
warning values, making them less reliable back ends for zutils. values, making them less reliable back ends for zutils.
@xref{compressor-requirements}. @xref{compressor-requirements}.
FORMAT NOTE 1: The @samp{--format} option allows the processing of a FORMAT NOTE 1: The option @samp{--format} allows the processing of a subset
subset of formats in recursive mode and when trying compressed file of formats in recursive mode and when trying compressed file names:
names: @w{@samp{zgrep foo -r --format=bz2,lz somedir somefile.tar}}. @w{@samp{zgrep foo -r --format=bz2,lz somedir somefile.tar}}.
FORMAT NOTE 2: If the @samp{--force-format} option is given, the files FORMAT NOTE 2: If the option @samp{--force-format} is given, the files are
are passed to the corresponding decompressor without verifying their passed to the corresponding decompressor without verifying their format,
format, allowing for example the processing of compress'd (.Z) files allowing for example the processing of compress'd (.Z) files with gzip:
with gzip: @w{@samp{zcmp --force-format=gz file.Z file.lz}}. @w{@samp{zcmp --force-format=gz file.Z file.lz}}.
LANGUAGE NOTE: Uncompressed = not compressed = plain data; it may never LANGUAGE NOTE: Uncompressed = not compressed = plain data; it may never have
have been compressed. Decompressed is used to refer to data which have been compressed. Decompressed is used to refer to data which have undergone
undergone the process of decompression. the process of decompression.
@sp 1 @sp 1
Numbers given as arguments to options (positions, sizes) may be followed Numbers given as arguments to options (positions, sizes) may be followed
by a multiplier and an optional @samp{B} for "byte". by a multiplier and an optional @samp{B} for "byte".
Table of SI and binary prefixes (unit multipliers): Table of SI and binary prefixes (unit multipliers):
@multitable {Prefix} {kilobyte (10^3 = 1000)} {|} {Prefix} {kibibyte (2^10 = 10 24)} @multitable {Prefix} {kilobyte (10^3 = 1000)} {|} {Prefix} {kibibyte (2^10 = 10 24)}
@item Prefix @tab Value @tab | @tab Prefix @tab Value @item Prefix @tab Value @tab | @tab Prefix @tab Value
@item k @tab kilobyte (10^3 = 1000) @tab | @tab Ki @tab kibibyte (2^10 = 1024) @item k @tab kilobyte (10^3 = 1000) @tab | @tab Ki @tab kibibyte (2^10 = 1024)
skipping to change at line 120 skipping to change at line 121
@item P @tab petabyte (10^15) @tab | @tab Pi @tab pebibyte (2^50) @item P @tab petabyte (10^15) @tab | @tab Pi @tab pebibyte (2^50)
@item E @tab exabyte (10^18) @tab | @tab Ei @tab exbibyte (2^60) @item E @tab exabyte (10^18) @tab | @tab Ei @tab exbibyte (2^60)
@item Z @tab zettabyte (10^21) @tab | @tab Zi @tab zebibyte (2^70) @item Z @tab zettabyte (10^21) @tab | @tab Zi @tab zebibyte (2^70)
@item Y @tab yottabyte (10^24) @tab | @tab Yi @tab yobibyte (2^80) @item Y @tab yottabyte (10^24) @tab | @tab Yi @tab yobibyte (2^80)
@end multitable @end multitable
@node Common options @node Common options
@chapter Common options @chapter Common options
@cindex common options @cindex common options
The following options are available in all the utilities. Rather than The following
writing identical descriptions for each of the programs, they are @uref{http://www.nongnu.org/arg-parser/manual/arg_parser_manual.html#Argument-sy
described here. ntax,,options}:
are available in all the utilities. Rather than writing identical
descriptions for each of the programs, they are described here.
@ifnothtml
@xref{Argument syntax,,,arg_parser}.
@end ifnothtml
@table @code @table @code
@item -h @item -h
@itemx --help @itemx --help
Print an informative help message describing the options and exit. zgrep Print an informative help message describing the options and exit. zgrep
only supports the @samp{--help} form of this option. only supports the @samp{--help} form of this option.
@item -V @item -V
@itemx --version @itemx --version
Print the version number on the standard output and exit. Print the version number on the standard output and exit.
This version number should be included in all bug reports. This version number should be included in all bug reports.
@item -M @var{format_list} @item -M @var{format_list}
@itemx --format=@var{format_list} @itemx --format=@var{format_list}
Process only the formats listed in the comma-separated Process only the formats listed in the comma-separated
@var{format_list}. Valid formats are @samp{bz2}, @samp{gz}, @samp{lz}, @var{format_list}. Valid formats are @samp{bz2}, @samp{gz}, @samp{lz},
@samp{xz} and @samp{un} for @samp{uncompressed}, meaning "any file name @samp{xz}, and @samp{un} for @samp{uncompressed}, meaning "any file name
without a known extension". This option excludes files based on without a known extension". This option excludes files based on
extension, instead of format, because it is more efficient. The extension, instead of format, because it is more efficient. The
exclusion only applies to names generated automatically (for example exclusion only applies to names generated automatically (for example
when adding extensions to a file name or when operating recursively on when adding extensions to a file name or when operating recursively on
directories). Files given in the command line are always processed. directories). Files given in the command line are always processed.
Each format in @var{format_list} enables file names with the following Each format in @var{format_list} enables file names with the following
extensions: extensions:
@multitable {bz2} {enables} {any other file name} @multitable {bz2} {enables} {any other file name}
skipping to change at line 165 skipping to change at line 170
@end multitable @end multitable
@item -N @item -N
@itemx --no-rcfile @itemx --no-rcfile
Don't read the runtime configuration file @samp{zutilsrc}. Don't read the runtime configuration file @samp{zutilsrc}.
@item --bz2=@var{command} @item --bz2=@var{command}
@itemx --gz=@var{command} @itemx --gz=@var{command}
@itemx --lz=@var{command} @itemx --lz=@var{command}
@itemx --xz=@var{command} @itemx --xz=@var{command}
Set program (may include arguments) to be used as (de)compressor for the Set program to be used as (de)compressor for the corresponding format.
given format. The name of the program can't begin with @samp{-}. These @var{command} may include arguments. For example
options override the values set in @file{zutilsrc}. The compression @w{@samp{--lz='plzip --threads=2'}}. The program set with @samp{--lz} is
program used must meet three requirements: used for both compression and decompression. The other three are used only
for decompression. The name of the program can't begin with @samp{-}. These
options override the values set in @file{zutilsrc}. The compression program
used must meet three requirements:
@anchor{compressor-requirements} @anchor{compressor-requirements}
@enumerate @enumerate
@item @item
When called with the @samp{-d} option, it must read compressed data from When called with the option @samp{-d}, it must read compressed data from
the standard input and produce decompressed data on the standard output. the standard input and produce decompressed data on the standard output.
@item @item
If the @samp{-q} option is passed to zutils, the compression program If the option @samp{-q} is passed to zutils, the compression program must
must also accept it. also accept it.
@item @item
It must return 0 if no errors occurred, and a non-zero value otherwise. It must return 0 if no errors occurred, and a non-zero value otherwise.
@end enumerate @end enumerate
@end table @end table
@node The zutilsrc file @node The zutilsrc file
@chapter The zutilsrc file @chapter The zutilsrc file
@cindex the zutilsrc file @cindex the zutilsrc file
skipping to change at line 205 skipping to change at line 213
You may copy the system @file{zutilsrc} file You may copy the system @file{zutilsrc} file
@file{$@{sysconfdir@}/zutilsrc} to @file{$HOME/.zutilsrc} and customize @file{$@{sysconfdir@}/zutilsrc} to @file{$HOME/.zutilsrc} and customize
these options as you like. The file syntax is fairly obvious (and there these options as you like. The file syntax is fairly obvious (and there
are further instructions in it): are further instructions in it):
@enumerate @enumerate
@item @item
Any line beginning with @samp{#} is a comment line. Any line beginning with @samp{#} is a comment line.
@item @item
Each non-comment line defines the command to be used for the given Each non-comment line defines the command to be used for the corresponding
format, with the syntax: format, with the syntax:
@example @example
<format> = <compressor> [options] <format> = <compressor> [options]
@end example @end example
where <format> is one of @samp{bz2}, @samp{gz}, @samp{lz} or @samp{xz}. where <format> is one of @samp{bz2}, @samp{gz}, @samp{lz}, or @samp{xz}.
@end enumerate @end enumerate
@node Zcat @node Zcat
@chapter Zcat @chapter Zcat
@cindex zcat @cindex zcat
zcat copies each given file to standard output. If any given file is zcat copies each @var{file} argument to standard output in sequence. If any
compressed, its decompressed content is used. If a given file does not file given is compressed, its decompressed content is copied. If a file
exist, and its name does not end with one of the known extensions, zcat given does not exist, and its name does not end with one of the known
tries the compressed file names corresponding to the formats supported. extensions, zcat tries the compressed file names corresponding to the
If a file fails to decompress, zcat continues copying the rest of the formats supported. If a file fails to decompress, zcat continues copying the
files. rest of the files.
If a file is specified as @samp{-}, data are read from standard input, If a file is specified as @samp{-}, data are read from standard input,
decompressed if needed, and sent to standard output. Data read from decompressed if needed, and sent to standard output. Data read from
standard input must be of the same type; all uncompressed or all in the standard input must be of the same type; all uncompressed or all in the
same compression format. same compressed format.
If no files are specified, recursive searches examine the current If no files are specified, recursive searches examine the current working
working directory, and nonrecursive searches read standard input. directory, and nonrecursive searches read standard input.
The format for running zcat is: The format for running zcat is:
@example @example
zcat [@var{options}] [@var{files}] zcat [@var{options}] [@var{files}]
@end example @end example
@noindent @noindent
Exit status is 0 if no errors occurred, non-zero otherwise. Exit status is 0 if no errors occurred, 1 otherwise.
zcat supports the following options: zcat supports the following options:
@table @code @table @code
@item -A @item -A
@itemx --show-all @itemx --show-all
Equivalent to @samp{-vET}. Equivalent to @samp{-vET}.
@item -b @item -b
@itemx --number-nonblank @itemx --number-nonblank
skipping to change at line 266 skipping to change at line 274
@item -E @item -E
@itemx --show-ends @itemx --show-ends
Print a @samp{$} after the end of each line. Print a @samp{$} after the end of each line.
@item -n @item -n
@itemx --number @itemx --number
Number all output lines, starting with 1. The line count is unlimited. Number all output lines, starting with 1. The line count is unlimited.
@item -O @var{format} @item -O @var{format}
@itemx --force-format=@var{format} @itemx --force-format=@var{format}
Force the given compression format. Valid values for @var{format} are Force the compressed format given. Valid values for @var{format} are
@samp{bz2}, @samp{gz}, @samp{lz} and @samp{xz}. If this option is used, @samp{bz2}, @samp{gz}, @samp{lz}, and @samp{xz}. If this option is used,
the files are passed to the corresponding decompressor without verifying the files are passed to the corresponding decompressor without verifying
their format, and the exact file name must be given. Other names won't their format, and the exact file name must be given. Other names won't
be tried. be tried.
@item -q @item -q
@itemx --quiet @itemx --quiet
Quiet operation. Suppress all messages. Quiet operation. Suppress all messages.
@item -r @item -r
@itemx --recursive @itemx --recursive
For each directory operand, read and process all files in that For each directory operand, read and process all files in that directory,
directory, recursively. Follow symbolic links in the command line, but recursively. Follow symbolic links given in the command line, but skip
skip symlinks that are encountered recursively. symbolic links that are encountered recursively.
@item -R @item -R
@itemx --dereference-recursive @itemx --dereference-recursive
For each directory operand, read and process all files in that For each directory operand, read and process all files in that directory,
directory, recursively, following all symbolic links. recursively, following all symbolic links.
@item -s @item -s
@itemx --squeeze-blank @itemx --squeeze-blank
Replace multiple adjacent blank lines with a single blank line. Replace multiple adjacent blank lines with a single blank line.
@item -t @item -t
Equivalent to @samp{-vT}. Equivalent to @samp{-vT}.
@item -T @item -T
@itemx --show-tabs @itemx --show-tabs
skipping to change at line 313 skipping to change at line 321
@item --verbose @item --verbose
Verbose mode. Show error messages. Verbose mode. Show error messages.
@end table @end table
@node Zcmp @node Zcmp
@chapter Zcmp @chapter Zcmp
@cindex zcmp @cindex zcmp
zcmp compares two files (@samp{-} means standard input), and if they zcmp compares two files and, if they differ, writes to standard output the
differ, tells the first byte and line number where they differ. Bytes first byte and line number where they differ. Bytes and lines are numbered
and lines are numbered starting with 1. If any given file is compressed, starting with 1. A hyphen @samp{-} used as a @var{file} argument means
its decompressed content is used. Compressed files are decompressed on standard input. If any file given is compressed, its decompressed content is
the fly; no temporary files are created. used. Compressed files are decompressed on the fly; no temporary files are
created.
The format for running zcmp is: The format for running zcmp is:
@example @example
zcmp [@var{options}] @var{file1} [@var{file2}] zcmp [@var{options}] @var{file1} [@var{file2}]
@end example @end example
@noindent @noindent
This compares @var{file1} to @var{file2}. If @var{file2} is omitted zcmp This compares @var{file1} to @var{file2}. The standard input is used only if
tries the following: @var{file1} or @var{file2} refers to standard input. If @var{file2} is
omitted zcmp tries the following:
@enumerate @itemize -
@item @item
If @var{file1} is compressed, compares its decompressed contents with If @var{file1} is compressed, compares its decompressed contents with
the corresponding uncompressed file (the name of @var{file1} with the the corresponding uncompressed file (the name of @var{file1} with the
extension removed). extension removed).
@item @item
If @var{file1} is uncompressed, compares it with the decompressed If @var{file1} is uncompressed, compares it with the decompressed
contents of @var{file1}.[lz|bz2|gz|xz] (the first one that is found). contents of @var{file1}.[lz|bz2|gz|xz] (the first one that is found).
@item @end itemize
If no suitable file is found, compares @var{file1} with data read from
standard input.
@end enumerate
@noindent @noindent
An exit status of 0 means no differences were found, 1 means some An exit status of 0 means no differences were found, 1 means some
differences were found, and 2 means trouble. differences were found, and 2 means trouble.
zcmp supports the following options: zcmp supports the following options:
@table @code @table @code
@item -b @item -b
@itemx --print-bytes @itemx --print-bytes
skipping to change at line 376 skipping to change at line 383
@itemx --verbose @itemx --verbose
Print the byte numbers (in decimal) and values (in octal) of all Print the byte numbers (in decimal) and values (in octal) of all
differing bytes. differing bytes.
@item -n @var{count} @item -n @var{count}
@itemx --bytes=@var{count} @itemx --bytes=@var{count}
Compare at most @var{count} input bytes. Compare at most @var{count} input bytes.
@item -O [@var{format1}][,@var{format2}] @item -O [@var{format1}][,@var{format2}]
@itemx --force-format=[@var{format1}][,@var{format2}] @itemx --force-format=[@var{format1}][,@var{format2}]
Force the given compression formats. Any of @var{format1} or Force the compressed formats given. Any of @var{format1} or
@var{format2} may be omitted and the corresponding format will be @var{format2} may be omitted and the corresponding format will be
automatically detected. Valid values for @var{format} are @samp{bz2}, automatically detected. Valid values for @var{format} are @samp{bz2},
@samp{gz}, @samp{lz} and @samp{xz}. If at least one format is specified @samp{gz}, @samp{lz}, and @samp{xz}. If at least one format is specified
with this option, the file is passed to the corresponding decompressor with this option, the file is passed to the corresponding decompressor
without verifying its format, and the exact file names of both without verifying its format, and the exact file names of both
@var{file1} and @var{file2} must be given. Other names won't be tried. @var{file1} and @var{file2} must be given. Other names won't be tried.
@item -q @item -q
@itemx -s @itemx -s
@itemx --quiet @itemx --quiet
@itemx --silent @itemx --silent
Don't print anything; only return an exit status indicating whether the Don't print anything; only return an exit status indicating whether the
files differ. files differ.
@end table @end table
@node Zdiff @node Zdiff
@chapter Zdiff @chapter Zdiff
@cindex zdiff @cindex zdiff
zdiff compares two files (@samp{-} means standard input), and if they zdiff compares two files and, if they differ, writes to standard output the
differ, shows the differences line by line. If any given file is differences line by line. A hyphen @samp{-} used as a @var{file} argument
compressed, its decompressed content is used. zdiff is a front end to means standard input. If any file given is compressed, its decompressed
the diff program and has the limitation that messages from diff refer to content is used. zdiff is a front end to the program diff and has the
temporary file names instead of those specified. limitation that messages from diff refer to temporary file names instead of
those specified.
The format for running zdiff is: The format for running zdiff is:
@example @example
zdiff [@var{options}] @var{file1} [@var{file2}] zdiff [@var{options}] @var{file1} [@var{file2}]
@end example @end example
@noindent @noindent
This compares @var{file1} to @var{file2}. If @var{file2} is omitted This compares @var{file1} to @var{file2}. The standard input is used only if
zdiff tries the following: @var{file1} or @var{file2} refers to standard input. If @var{file2} is
omitted zdiff tries the following:
@enumerate @itemize -
@item @item
If @var{file1} is compressed, compares its decompressed contents with If @var{file1} is compressed, compares its decompressed contents with
the corresponding uncompressed file (the name of @var{file1} with the the corresponding uncompressed file (the name of @var{file1} with the
extension removed). extension removed).
@item @item
If @var{file1} is uncompressed, compares it with the decompressed If @var{file1} is uncompressed, compares it with the decompressed
contents of @var{file1}.[lz|bz2|gz|xz] (the first one that is found). contents of @var{file1}.[lz|bz2|gz|xz] (the first one that is found).
@item @end itemize
If no suitable file is found, compares @var{file1} with data read from
standard input.
@end enumerate
@noindent @noindent
An exit status of 0 means no differences were found, 1 means some An exit status of 0 means no differences were found, 1 means some
differences were found, and 2 means trouble. differences were found, and 2 means trouble.
zdiff supports the following options (some options only work if the diff zdiff supports the following options (some options only work if the diff
program used supports them): program used supports them):
@table @code @table @code
@item -a @item -a
skipping to change at line 467 skipping to change at line 473
@item -E @item -E
@itemx --ignore-tab-expansion @itemx --ignore-tab-expansion
Ignore changes due to tab expansion. Ignore changes due to tab expansion.
@item -i @item -i
@itemx --ignore-case @itemx --ignore-case
Ignore case differences in file contents. Ignore case differences in file contents.
@item -O [@var{format1}][,@var{format2}] @item -O [@var{format1}][,@var{format2}]
@itemx --force-format=[@var{format1}][,@var{format2}] @itemx --force-format=[@var{format1}][,@var{format2}]
Force the given compression formats. Any of @var{format1} or Force the compressed formats given. Any of @var{format1} or
@var{format2} may be omitted and the corresponding format will be @var{format2} may be omitted and the corresponding format will be
automatically detected. Valid values for @var{format} are @samp{bz2}, automatically detected. Valid values for @var{format} are @samp{bz2},
@samp{gz}, @samp{lz} and @samp{xz}. If at least one format is specified @samp{gz}, @samp{lz}, and @samp{xz}. If at least one format is specified
with this option, the file is passed to the corresponding decompressor with this option, the file is passed to the corresponding decompressor
without verifying its format, and the exact file names of both without verifying its format, and the exact file names of both
@var{file1} and @var{file2} must be given. Other names won't be tried. @var{file1} and @var{file2} must be given. Other names won't be tried.
@item -p @item -p
@itemx --show-c-function @itemx --show-c-function
Show which C function each change is in. Show which C function each change is in.
@item -q @item -q
@itemx --brief @itemx --brief
skipping to change at line 512 skipping to change at line 518
@item -w @item -w
@itemx --ignore-all-space @itemx --ignore-all-space
Ignore all white space. Ignore all white space.
@end table @end table
@node Zgrep @node Zgrep
@chapter Zgrep @chapter Zgrep
@cindex zgrep @cindex zgrep
zgrep is a front end to the grep program that allows transparent search zgrep is a front end to the program grep that allows transparent search
on any combination of compressed and uncompressed files. If any given on any combination of compressed and uncompressed files. If any file
file is compressed, its decompressed content is used. If a given file given is compressed, its decompressed content is used. If a file given
does not exist, and its name does not end with one of the known does not exist, and its name does not end with one of the known
extensions, zgrep tries the compressed file names corresponding to the extensions, zgrep tries the compressed file names corresponding to the
formats supported. If a file fails to decompress, zgrep continues formats supported. If a file fails to decompress, zgrep continues
searching the rest of the files. searching the rest of the files.
If a file is specified as @samp{-}, data are read from standard input, If a file is specified as @samp{-}, data are read from standard input,
decompressed if needed, and fed to grep. Data read from standard input decompressed if needed, and fed to grep. Data read from standard input
must be of the same type; all uncompressed or all in the same must be of the same type; all uncompressed or all in the same
compression format. compressed format.
If no files are specified, recursive searches examine the current If no files are specified, recursive searches examine the current working
working directory, and nonrecursive searches read standard input. directory, and nonrecursive searches read standard input.
The format for running zgrep is: The format for running zgrep is:
@example @example
zgrep [@var{options}] @var{pattern} [@var{files}] zgrep [@var{options}] @var{pattern} [@var{files}]
@end example @end example
@noindent @noindent
An exit status of 0 means at least one match was found, 1 means no An exit status of 0 means at least one match was found, 1 means no
matches were found, and 2 means trouble. matches were found, and 2 means trouble.
skipping to change at line 567 skipping to change at line 573
@item -c @item -c
@itemx --count @itemx --count
Only print a count of matching lines per file. Only print a count of matching lines per file.
@item -C @var{n} @item -C @var{n}
@itemx --context=@var{n} @itemx --context=@var{n}
Print @var{n} lines of output context. Print @var{n} lines of output context.
@item --color[=@var{when}] @item --color[=@var{when}]
Show matched strings in color. @var{when} is @samp{never}, @samp{always} Show matched strings in color. @var{when} is @samp{never}, @samp{always},
or @samp{auto}. or @samp{auto}.
@item -e @var{pattern} @item -e @var{pattern}
@itemx --regexp=@var{pattern} @itemx --regexp=@var{pattern}
Use @var{pattern} as the pattern to match. Use @var{pattern} as the pattern to match.
@item -E @item -E
@itemx --extended-regexp @itemx --extended-regexp
Treat @var{pattern} as an extended regular expression. Treat @var{pattern} as an extended regular expression.
@item -f @var{file} @item -f @var{file}
@itemx --file=@var{file} @itemx --file=@var{file}
Obtain patterns from @var{file}, one per line.@* Obtain patterns from @var{file}, one per line.@*
When searching in several files at once, command substitution can be When searching in several files at once, command substitution can be
used with @code{-e} to read @var{file} only once, for example if used with @samp{-e} to read @var{file} only once, for example if
@var{file} is not a regular file: @var{file} is not a regular file:
@w{@code{zgrep -e "$(cat @var{file})" file1.lz file2.gz}} @w{@samp{zgrep -e "$(cat @var{file})" file1.lz file2.gz}}
@item -F @item -F
@itemx --fixed-strings @itemx --fixed-strings
Treat @var{pattern} as a set of newline-separated strings. Treat @var{pattern} as a set of newline-separated strings.
@item -h @item -h
@itemx --no-filename @itemx --no-filename
Suppress the prefixing of file names on output when multiple files are Suppress the prefixing of file names on output when multiple files are
searched. searched.
skipping to change at line 628 skipping to change at line 634
@item -n @item -n
@itemx --line-number @itemx --line-number
Prefix each matched line with its line number in the input file. Prefix each matched line with its line number in the input file.
@item -o @item -o
@itemx --only-matching @itemx --only-matching
Show only the part of matching lines that actually matches @var{pattern}. Show only the part of matching lines that actually matches @var{pattern}.
@item -O @var{format} @item -O @var{format}
@itemx --force-format=@var{format} @itemx --force-format=@var{format}
Force the given compression format. Valid values for @var{format} are Force the compressed format given. Valid values for @var{format} are
@samp{bz2}, @samp{gz}, @samp{lz} and @samp{xz}. If this option is used, @samp{bz2}, @samp{gz}, @samp{lz}, and @samp{xz}. If this option is used,
the files are passed to the corresponding decompressor without verifying the files are passed to the corresponding decompressor without verifying
their format, and the exact file name must be given. Other names won't their format, and the exact file name must be given. Other names won't
be tried. be tried.
@item -q @item -q
@itemx --quiet @itemx --quiet
Suppress all messages. Exit immediately with zero status if any match is Suppress all messages. Exit immediately with zero status if any match is
found, even if an error was detected. found, even if an error was detected.
@item -r @item -r
@itemx --recursive @itemx --recursive
For each directory operand, read and process all files in that For each directory operand, read and process all files in that directory,
directory, recursively. Follow symbolic links in the command line, but recursively. Follow symbolic links given in the command line, but skip
skip symlinks that are encountered recursively. symbolic links that are encountered recursively.
@item -R @item -R
@itemx --dereference-recursive @itemx --dereference-recursive
For each directory operand, read and process all files in that For each directory operand, read and process all files in that directory,
directory, recursively, following all symbolic links. recursively, following all symbolic links.
@item -s @item -s
@itemx --no-messages @itemx --no-messages
Suppress error messages about nonexistent or unreadable files. Suppress error messages about nonexistent or unreadable files.
@item -v @item -v
@itemx --invert-match @itemx --invert-match
Select non-matching lines. Select non-matching lines.
@item --verbose @item --verbose
skipping to change at line 675 skipping to change at line 681
@item -x @item -x
@itemx --line-regexp @itemx --line-regexp
Match only whole lines. Match only whole lines.
@end table @end table
@node Ztest @node Ztest
@chapter Ztest @chapter Ztest
@cindex ztest @cindex ztest
ztest verifies the integrity of the specified compressed files. ztest verifies the integrity of the compressed files specified.
Uncompressed files are ignored. If a file is specified as @samp{-}, the Uncompressed files are ignored. If a file is specified as @samp{-}, the
integrity of compressed data read from standard input is verified. Data integrity of compressed data read from standard input is verified. Data
read from standard input must be all in the same compression format. If read from standard input must be all in the same compressed format. If
a file fails to decompress, ztest continues verifying the rest of the a file fails to decompress, does not exist, can't be opened, or is a
files. terminal, ztest continues verifying the rest of the files. A final
diagnostic is shown at verbosity level 1 or higher if any file fails the
test when testing multiple files.
If no files are specified, recursive searches examine the current If no files are specified, recursive searches examine the current working
working directory, and nonrecursive searches read standard input. directory, and nonrecursive searches read standard input.
Note that error detection in the xz format is broken. First, some xz Note that error detection in the xz format is broken. First, some xz
files lack integrity information. Second, not all xz decompressors can files lack integrity information. Second, not all xz decompressors can
@uref{http://www.nongnu.org/lzip/xz_inadequate.html#fragmented,,verify the integ rity} @uref{http://www.nongnu.org/lzip/xz_inadequate.html#fragmented,,verify the integ rity}
of all xz files. Third, section 2.1.1.2 'Stream Flags' of the of all xz files. Third, section 2.1.1.2 'Stream Flags' of the
@uref{http://tukaani.org/xz/xz-file-format.txt,,xz format specification} @uref{http://tukaani.org/xz/xz-file-format.txt,,xz format specification}
allows xz decompressors to produce garbage output without issuing any allows xz decompressors to produce garbage output without issuing any
warning. Therefore, xz files can't always be verified as reliably as warning. Therefore, xz files can't always be verified as reliably as
files in the other formats can. files in the other formats can.
@c We can only hope that xz is soon abandoned. @c We can only hope that xz is soon abandoned.
skipping to change at line 711 skipping to change at line 719
@noindent @noindent
The exit status is 0 if all compressed files verify OK, 1 if The exit status is 0 if all compressed files verify OK, 1 if
environmental problems (file not found, invalid flags, I/O errors, etc), environmental problems (file not found, invalid flags, I/O errors, etc),
2 if any compressed file is corrupt or invalid. 2 if any compressed file is corrupt or invalid.
ztest supports the following options: ztest supports the following options:
@table @code @table @code
@item -O @var{format} @item -O @var{format}
@itemx --force-format=@var{format} @itemx --force-format=@var{format}
Force the given compression format. Valid values for @var{format} are Force the compressed format given. Valid values for @var{format} are
@samp{bz2}, @samp{gz}, @samp{lz} and @samp{xz}. If this option is used, @samp{bz2}, @samp{gz}, @samp{lz}, and @samp{xz}. If this option is used, the
the files are passed to the corresponding decompressor without verifying files are passed to the corresponding decompressor without verifying their
their format, and any files in a format that the decompressor can't format, and any files in a format that the decompressor can't understand
understand will fail. For example, @samp{--force-format=gz} can test will fail. For example, @samp{--force-format=gz} can test gzipped (.gz) and
gzipped (.gz) and compress'd (.Z) files if the compressor used is GNU compress'd (.Z) files if the compressor used is GNU gzip.
gzip.
@item -q @item -q
@itemx --quiet @itemx --quiet
Quiet operation. Suppress all messages. Quiet operation. Suppress all messages.
@item -r @item -r
@itemx --recursive @itemx --recursive
For each directory operand, read and process all files in that For each directory operand, read and process all files in that directory,
directory, recursively. Follow symbolic links in the command line, but recursively. Follow symbolic links given in the command line, but skip
skip symlinks that are encountered recursively. symbolic links that are encountered recursively.
@item -R @item -R
@itemx --dereference-recursive @itemx --dereference-recursive
For each directory operand, read and process all files in that For each directory operand, read and process all files in that directory,
directory, recursively, following all symbolic links. recursively, following all symbolic links.
@item -v @item -v
@itemx --verbose @itemx --verbose
Verbose mode. Show the verify status for each file processed.@* Verbose mode. Show the verify status for each file processed.@*
Further -v's increase the verbosity level. Further -v's increase the verbosity level.
@end table @end table
@node Zupdate @node Zupdate
@chapter Zupdate @chapter Zupdate
@cindex zupdate @cindex zupdate
zupdate recompresses files from bzip2, gzip, and xz formats to lzip zupdate recompresses files from bzip2, gzip, and xz formats to lzip format.
format. Each original is compared with the new file and then deleted. Each original is compared with the new file and then deleted. Only regular
Only regular files with standard file name extensions are recompressed, files with standard file name extensions are recompressed, other files are
other files are ignored. Compressed files are decompressed and then ignored. Compressed files are decompressed and then recompressed on the fly;
recompressed on the fly; no temporary files are created. If an error no temporary files are created. If an error happens while recompressing a
happens while recompressing a file, zupdate exits immediately without file, zupdate exits immediately without recompressing the rest of the files.
recompressing the rest of the files. The lzip format is chosen as The lzip format is chosen as destination because it is the most appropriate
destination because it is the most appropriate for long-term data for long-term data archiving.
archiving.
If no files are specified, recursive searches examine the current If no files are specified, recursive searches examine the current working
working directory, and nonrecursive searches do nothing. directory, and nonrecursive searches do nothing.
If the lzip compressed version of a file already exists, the file is If the lzip compressed version of a file already exists, the file is
skipped unless the @samp{--force} option is given. In this case, if the skipped unless the option @samp{--force} is given. In this case, if the
comparison with the existing lzip version fails, an error is returned comparison with the existing lzip version fails, an error is returned
and the original file is not deleted. The operation of zupdate is meant and the original file is not deleted. The operation of zupdate is meant
to be safe and not produce any data loss. Therefore, existing lzip to be safe and not cause any data loss. Therefore, existing lzip
compressed files are never overwritten nor deleted. compressed files are never overwritten nor deleted.
Combining the @samp{--force} and @samp{--keep} options, as in Combining the options @samp{--force} and @samp{--keep}, as in
@w{@code{zupdate -f -k *.gz}}, verifies that there are no differences @w{@samp{zupdate -f -k *.gz}}, verifies that there are no differences
between each pair of files in a multiformat set of files. between each pair of files in a multiformat set of files.
The names of the original files must have one of the following The names of the original files must have one of the following extensions:@*
extensions: @samp{.bz2}, @samp{.tbz}, @samp{.tbz2}, @samp{.gz}, @samp{.bz2}, @samp{.gz}, and @samp{.xz} are recompressed to @samp{.lz}.@*
@samp{.tgz}, @samp{.xz}, @samp{.txz}. The files produced have the @samp{.tbz}, @samp{.tbz2}, @samp{.tgz}, and @samp{.txz} are recompressed to
extensions @samp{.lz} or @samp{.tar.lz}. @samp{.tlz}.@*
Keeping the combined extensions (@samp{.tgz} --> @samp{.tlz}) may be useful
Recompressing a file is much like copying or moving it; therefore when recompressing Slackware packages, for example.
zupdate preserves the access and modification dates, permissions, and,
when possible, ownership of the file just as @samp{cp -p} does. (If the user Recompressing a file is much like copying or moving it; therefore zupdate
ID or the group ID can't be duplicated, the file permission bits S_ISUID preserves the access and modification dates, permissions, and, when
and S_ISGID are cleared). possible, ownership of the file just as @samp{cp -p} does. (If the user ID or
the group ID can't be duplicated, the file permission bits S_ISUID and
S_ISGID are cleared).
The format for running zupdate is: The format for running zupdate is:
@example @example
zupdate [@var{options}] [@var{files}] zupdate [@var{options}] [@var{files}]
@end example @end example
@noindent @noindent
Exit status is 0 if all the compressed files were successfully Exit status is 0 if all the compressed files were successfully recompressed
recompressed (if needed), compared and deleted (if requested). Non-zero (if needed), compared, and deleted (if requested). Non-zero otherwise.
otherwise.
zupdate supports the following options: zupdate supports the following options:
@table @code @table @code
@item -f @item -f
@itemx --force @itemx --force
Don't skip a file for which a lzip compressed version already exists. Don't skip a file for which a lzip compressed version already exists.
@samp{--force} compares the content of the input file with the content @samp{--force} compares the content of the input file with the content
of the existing lzip file and deletes the input file if both contents of the existing lzip file and deletes the input file if both contents
are identical. are identical.
@item -k @item -k
@itemx --keep @itemx --keep
Keep (don't delete) the input file after comparing it with the lzip file. Keep (don't delete) the input file after comparing it with the lzip file.
@item -l @item -l
@itemx --lzip-verbose @itemx --lzip-verbose
Pass a @samp{-v} option to the lzip compressor so that it shows the Pass one option @samp{-v} to the lzip compressor so that it shows the
compression ratio for each file processed. Using lzip 1.15 and newer, a compression ratio for each file processed. Using lzip 1.15 or newer, a
second @samp{-l} shows the progress of compression. Use it together with second @samp{-l} shows the progress of compression. Use it together with
@samp{-v} to see the name of the file. @samp{-v} to see the name of the file.
@item -q @item -q
@itemx --quiet @itemx --quiet
Quiet operation. Suppress all messages. Quiet operation. Suppress all messages.
@item -r @item -r
@itemx --recursive @itemx --recursive
For each directory operand, read and process all files in that For each directory operand, read and process all files in that directory,
directory, recursively. Follow symbolic links in the command line, but recursively. Follow symbolic links given in the command line, but skip
skip symlinks that are encountered recursively. symbolic links that are encountered recursively.
@item -R @item -R
@itemx --dereference-recursive @itemx --dereference-recursive
For each directory operand, read and process all files in that For each directory operand, read and process all files in that directory,
directory, recursively, following all symbolic links. recursively, following all symbolic links.
@item -v @item -v
@itemx --verbose @itemx --verbose
Verbose mode. Show the files being processed. A second @samp{-v} also Verbose mode. Show the files being processed. A second @samp{-v} also
shows the files being ignored. shows the files being ignored.
@item -0 .. -9 @item -0 .. -9
Set the compression level of lzip. By default zupdate passes @samp{-9} Set the compression level of lzip. By default zupdate passes @samp{-9} to
to lzip. lzip. Custom compression options can be passed to lzip with the option
@samp{--lz}. For example @w{@samp{--lz='lzip -9 -s64MiB'}}.
@end table @end table
@node Problems @node Problems
@chapter Reporting bugs @chapter Reporting bugs
@cindex bugs @cindex bugs
@cindex getting help @cindex getting help
There are probably bugs in zutils. There are certainly errors and There are probably bugs in zutils. There are certainly errors and
omissions in this manual. If you report them, they will get fixed. If omissions in this manual. If you report them, they will get fixed. If
you don't, no one will ever know about them and they will remain unfixed you don't, no one will ever know about them and they will remain unfixed
for all eternity, if not longer. for all eternity, if not longer.
If you find a bug in zutils, please send electronic mail to If you find a bug in zutils, please send electronic mail to
@email{zutils-bug@@nongnu.org}. Include the version number, which you can @email{zutils-bug@@nongnu.org}. Include the version number, which you can
find by running @w{@code{zupdate --version}}. find by running @w{@samp{zupdate --version}}.
@node Concept index @node Concept index
@unnumbered Concept index @unnumbered Concept index
@printindex cp @printindex cp
@bye @bye
 End of changes. 60 change blocks. 
166 lines changed or deleted 175 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)