"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "doc/zutils.info" 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.info  (zutils-1.8.tar.lz):zutils.info  (zutils-1.9.tar.lz)
File: zutils.info, Node: Top, Next: Introduction, Up: (dir) File: zutils.info, Node: Top, Next: Introduction, Up: (dir)
Zutils Manual Zutils Manual
************* *************
This manual is for Zutils (version 1.8, 1 January 2019). This manual is for Zutils (version 1.9, 27 June 2020).
* Menu: * Menu:
* Introduction:: Purpose and features of zutils * Introduction:: Purpose and features of zutils
* Common options:: Options common to all utilities * Common options:: Options common to all utilities
* The zutilsrc file:: The zutils configuration file * The zutilsrc file:: The zutils configuration file
* Zcat:: Concatenating compressed files * Zcat:: Concatenating compressed files
* 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
Copyright (C) 2009-2019 Antonio Diaz Diaz. Copyright (C) 2009-2020 Antonio Diaz Diaz.
This manual is free documentation: you have unlimited permission to This manual is free documentation: you have unlimited permission to copy,
copy, distribute and modify it. distribute, and modify it.
File: zutils.info, Node: Introduction, Next: Common options, Prev: Top, Up: Top File: zutils.info, Node: Introduction, Next: Common options, Prev: Top, Up: Top
1 Introduction 1 Introduction
************** **************
Zutils is a collection of utilities able to process any combination of Zutils is a collection of utilities able to process any combination of
compressed and uncompressed files transparently. If any given file, compressed and uncompressed files transparently. If any file given,
including standard input, is compressed, its decompressed content is including standard input, is compressed, its decompressed content is used.
used. Compressed files are decompressed on the fly; no temporary files Compressed files are decompressed on the fly; no temporary files are
are created. created.
These utilities are not wrapper scripts but safer and more efficient These utilities are not wrapper scripts but safer and more efficient C++
C++ programs. In particular the '--recursive' option is very efficient programs. In particular the option '--recursive' is very efficient in those
in those utilities supporting it. utilities supporting it.
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 provided by GNU gzip. ztest is unique to zutils. zupdate is scripts provided by GNU gzip. ztest is unique to zutils. zupdate is similar
similar to gzip's znew. to gzip's znew.
NOTE: Bzip2 and lzip provide well-defined values of exit status, NOTE: Bzip2 and lzip provide well-defined values of exit status, which
which makes them safe to use with zutils. Gzip and xz may return makes them safe to use with zutils. Gzip and xz may return ambiguous warning
ambiguous warning values, making them less reliable back ends for values, making them less reliable back ends for zutils. *Note
zutils. *Note compressor-requirements::. compressor-requirements::.
FORMAT NOTE 1: The '--format' option allows the processing of a FORMAT NOTE 1: The option '--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: 'zgrep foo -r --format=bz2,lz somedir somefile.tar'. 'zgrep foo -r --format=bz2,lz somedir somefile.tar'.
FORMAT NOTE 2: If the '--force-format' option is given, the files FORMAT NOTE 2: If the option '--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: 'zcmp --force-format=gz file.Z file.lz'. 'zcmp --force-format=gz file.Z file.lz'.
LANGUAGE NOTE: Uncompressed = not compressed = plain data; it may LANGUAGE NOTE: Uncompressed = not compressed = plain data; it may never
never have been compressed. Decompressed is used to refer to data which have been compressed. Decompressed is used to refer to data which have
have undergone the process of decompression. undergone the process of decompression.
Numbers given as arguments to options (positions, sizes) may be Numbers given as arguments to options (positions, sizes) may be followed
followed by a multiplier and an optional 'B' for "byte". by a multiplier and an optional 'B' for "byte".
Table of SI and binary prefixes (unit multipliers): Table of SI and binary prefixes (unit multipliers):
Prefix Value | Prefix Value Prefix Value | Prefix Value
k kilobyte (10^3 = 1000) | Ki kibibyte (2^10 = 1024) k kilobyte (10^3 = 1000) | Ki kibibyte (2^10 = 1024)
M megabyte (10^6) | Mi mebibyte (2^20) M megabyte (10^6) | Mi mebibyte (2^20)
G gigabyte (10^9) | Gi gibibyte (2^30) G gigabyte (10^9) | Gi gibibyte (2^30)
T terabyte (10^12) | Ti tebibyte (2^40) T terabyte (10^12) | Ti tebibyte (2^40)
P petabyte (10^15) | Pi pebibyte (2^50) P petabyte (10^15) | Pi pebibyte (2^50)
E exabyte (10^18) | Ei exbibyte (2^60) E exabyte (10^18) | Ei exbibyte (2^60)
Z zettabyte (10^21) | Zi zebibyte (2^70) Z zettabyte (10^21) | Zi zebibyte (2^70)
Y yottabyte (10^24) | Yi yobibyte (2^80) Y yottabyte (10^24) | Yi yobibyte (2^80)
File: zutils.info, Node: Common options, Next: The zutilsrc file, Prev: Intro duction, Up: Top File: zutils.info, Node: Common options, Next: The zutilsrc file, Prev: Intro duction, Up: Top
2 Common options 2 Common options
**************** ****************
The following options are available in all the utilities. Rather than The following options: are available in all the utilities. Rather than
writing identical descriptions for each of the programs, they are writing identical descriptions for each of the programs, they are described
described here. here. *Note Argument syntax: (arg_parser)Argument syntax.
'-h' '-h'
'--help' '--help'
Print an informative help message describing the options and exit. Print an informative help message describing the options and exit.
zgrep only supports the '--help' form of this option. zgrep only supports the '--help' form of this option.
'-V' '-V'
'--version' '--version'
Print the version number on the standard output and exit. This Print the version number on the standard output and exit. This version
version number should be included in all bug reports. number should be included in all bug reports.
'-M FORMAT_LIST' '-M FORMAT_LIST'
'--format=FORMAT_LIST' '--format=FORMAT_LIST'
Process only the formats listed in the comma-separated Process only the formats listed in the comma-separated FORMAT_LIST.
FORMAT_LIST. Valid formats are 'bz2', 'gz', 'lz', 'xz' and 'un' Valid formats are 'bz2', 'gz', 'lz', 'xz', and 'un' for
for 'uncompressed', meaning "any file name without a known 'uncompressed', meaning "any file name without a known extension".
extension". This option excludes files based on extension, instead This option excludes files based on extension, instead of format,
of format, because it is more efficient. The exclusion only because it is more efficient. The exclusion only applies to names
applies to names generated automatically (for example when adding generated automatically (for example when adding extensions to a file
extensions to a file name or when operating recursively on name or when operating recursively on directories). Files given in the
directories). Files given in the command line are always processed. command line are always processed.
Each format in FORMAT_LIST enables file names with the following Each format in FORMAT_LIST enables file names with the following
extensions: extensions:
bz2 enables .bz2 .tbz .tbz2 bz2 enables .bz2 .tbz .tbz2
gz enables .gz .tgz gz enables .gz .tgz
lz enables .lz .tlz lz enables .lz .tlz
xz enables .xz .txz xz enables .xz .txz
un enables any other file name un enables any other file name
'-N' '-N'
'--no-rcfile' '--no-rcfile'
Don't read the runtime configuration file 'zutilsrc'. Don't read the runtime configuration file 'zutilsrc'.
'--bz2=COMMAND' '--bz2=COMMAND'
'--gz=COMMAND' '--gz=COMMAND'
'--lz=COMMAND' '--lz=COMMAND'
'--xz=COMMAND' '--xz=COMMAND'
Set program (may include arguments) to be used as (de)compressor Set program to be used as (de)compressor for the corresponding format.
for the given format. The name of the program can't begin with COMMAND may include arguments. For example '--lz='plzip --threads=2''.
'-'. These options override the values set in 'zutilsrc'. The The program set with '--lz' is used for both compression and
compression program used must meet three requirements: decompression. The other three are used only for decompression. The
name of the program can't begin with '-'. These options override the
1. When called with the '-d' option, it must read compressed values set in 'zutilsrc'. The compression program used must meet three
data from the standard input and produce decompressed data on requirements:
the standard output.
1. When called with the option '-d', it must read compressed data
from the standard input and produce decompressed data on the
standard output.
2. If the '-q' option is passed to zutils, the compression 2. If the option '-q' is passed to zutils, the compression program
program must also accept it. must also accept it.
3. It must return 0 if no errors occurred, and a non-zero value 3. It must return 0 if no errors occurred, and a non-zero value
otherwise. otherwise.
File: zutils.info, Node: The zutilsrc file, Next: Zcat, Prev: Common options, Up: Top File: zutils.info, Node: The zutilsrc file, Next: Zcat, Prev: Common options, Up: Top
3 The zutilsrc file 3 The zutilsrc file
******************* *******************
'zutilsrc' is the runtime configuration file for zutils. In it you may 'zutilsrc' is the runtime configuration file for zutils. In it you may
define the compressor name and options to be used for each format. The define the compressor name and options to be used for each format. The
'zutilsrc' file is optional; you don't need to install it in order to 'zutilsrc' file is optional; you don't need to install it in order to run
run zutils. zutils.
The compressors specified in the command line override those The compressors specified in the command line override those specified
specified in the 'zutilsrc' file. in the 'zutilsrc' file.
You may copy the system 'zutilsrc' file '${sysconfdir}/zutilsrc' to You may copy the system 'zutilsrc' file '${sysconfdir}/zutilsrc' to
'$HOME/.zutilsrc' and customize these options as you like. The file '$HOME/.zutilsrc' and customize these options as you like. The file syntax
syntax is fairly obvious (and there are further instructions in it): is fairly obvious (and there are further instructions in it):
1. Any line beginning with '#' is a comment line. 1. Any line beginning with '#' is a comment line.
2. Each non-comment line defines the command to be used for the given 2. Each non-comment line defines the command to be used for the
format, with the syntax: corresponding format, with the syntax:
<format> = <compressor> [options] <format> = <compressor> [options]
where <format> is one of 'bz2', 'gz', 'lz' or 'xz'. where <format> is one of 'bz2', 'gz', 'lz', or 'xz'.
File: zutils.info, Node: Zcat, Next: Zcmp, Prev: The zutilsrc file, Up: Top File: zutils.info, Node: Zcat, Next: Zcmp, Prev: The zutilsrc file, Up: Top
4 Zcat 4 Zcat
****** ******
zcat copies each given file to standard output. If any given file is zcat copies each FILE argument to standard output in sequence. If any file
compressed, its decompressed content is used. If a given file does not given is compressed, its decompressed content is copied. If a file given
exist, and its name does not end with one of the known extensions, zcat does not exist, and its name does not end with one of the known extensions,
tries the compressed file names corresponding to the formats supported. zcat tries the compressed file names corresponding to the formats
If a file fails to decompress, zcat continues copying the rest of the supported. If a file fails to decompress, zcat continues copying the rest
files. of the files.
If a file is specified as '-', data are read from standard input, If a file is specified as '-', 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:
zcat [OPTIONS] [FILES] zcat [OPTIONS] [FILES]
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:
'-A' '-A'
'--show-all' '--show-all'
Equivalent to '-vET'. Equivalent to '-vET'.
'-b' '-b'
'--number-nonblank' '--number-nonblank'
Number all nonblank output lines, starting with 1. The line count Number all nonblank output lines, starting with 1. The line count is
is unlimited. unlimited.
'-e' '-e'
Equivalent to '-vE'. Equivalent to '-vE'.
'-E' '-E'
'--show-ends' '--show-ends'
Print a '$' after the end of each line. Print a '$' after the end of each line.
'-n' '-n'
'--number' '--number'
Number all output lines, starting with 1. The line count is Number all output lines, starting with 1. The line count is unlimited.
unlimited.
'-O FORMAT' '-O FORMAT'
'--force-format=FORMAT' '--force-format=FORMAT'
Force the given compression format. Valid values for FORMAT are Force the compressed format given. Valid values for FORMAT are 'bz2',
'bz2', 'gz', 'lz' and 'xz'. If this option is used, the files are 'gz', 'lz', and 'xz'. If this option is used, the files are passed to
passed to the corresponding decompressor without verifying their the corresponding decompressor without verifying their format, and the
format, and the exact file name must be given. Other names won't exact file name must be given. Other names won't be tried.
be tried.
'-q' '-q'
'--quiet' '--quiet'
Quiet operation. Suppress all messages. Quiet operation. Suppress all messages.
'-r' '-r'
'--recursive' '--recursive'
For each directory operand, read and process all files in that For each directory operand, read and process all files in that
directory, recursively. Follow symbolic links in the command line, directory, recursively. Follow symbolic links given in the command
but skip symlinks that are encountered recursively. line, but skip symbolic links that are encountered recursively.
'-R' '-R'
'--dereference-recursive' '--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, recursively, following all symbolic links. directory, recursively, following all symbolic links.
'-s' '-s'
'--squeeze-blank' '--squeeze-blank'
Replace multiple adjacent blank lines with a single blank line. Replace multiple adjacent blank lines with a single blank line.
skipping to change at line 267 skipping to change at line 268
stands for "meta"). stands for "meta").
'--verbose' '--verbose'
Verbose mode. Show error messages. Verbose mode. Show error messages.
File: zutils.info, Node: Zcmp, Next: Zdiff, Prev: Zcat, Up: Top File: zutils.info, Node: Zcmp, Next: Zdiff, Prev: Zcat, Up: Top
5 Zcmp 5 Zcmp
****** ******
zcmp compares two files ('-' means standard input), and if they differ, zcmp compares two files and, if they differ, writes to standard output the
tells the first byte and line number where they differ. Bytes and lines first byte and line number where they differ. Bytes and lines are numbered
are numbered starting with 1. If any given file is compressed, its starting with 1. A hyphen '-' used as a FILE argument means standard input.
decompressed content is used. Compressed files are decompressed on the If any file given is compressed, its decompressed content is used.
fly; no temporary files are created. Compressed files are decompressed on the fly; no temporary files are
created.
The format for running zcmp is: The format for running zcmp is:
zcmp [OPTIONS] FILE1 [FILE2] zcmp [OPTIONS] FILE1 [FILE2]
This compares FILE1 to FILE2. If FILE2 is omitted zcmp tries the This compares FILE1 to FILE2. The standard input is used only if FILE1 or
FILE2 refers to standard input. If FILE2 is omitted zcmp tries the
following: following:
1. If FILE1 is compressed, compares its decompressed contents with - If FILE1 is compressed, compares its decompressed contents with the
the corresponding uncompressed file (the name of FILE1 with the corresponding uncompressed file (the name of FILE1 with the extension
extension removed). removed).
2. If FILE1 is uncompressed, compares it with the decompressed - If FILE1 is uncompressed, compares it with the decompressed contents
contents of FILE1.[lz|bz2|gz|xz] (the first one that is found). of FILE1.[lz|bz2|gz|xz] (the first one that is found).
3. If no suitable file is found, compares FILE1 with data read from
standard input.
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:
'-b' '-b'
'--print-bytes' '--print-bytes'
Print the differing bytes. Print control bytes as a '^' followed by Print the differing bytes. Print control bytes as a '^' followed by a
a letter, and precede bytes larger than 127 with 'M-' (which stands letter, and precede bytes larger than 127 with 'M-' (which stands for
for "meta"). "meta").
'-i SIZE' '-i SIZE'
'--ignore-initial=SIZE' '--ignore-initial=SIZE'
Ignore any differences in the first SIZE bytes of the input files. Ignore any differences in the first SIZE bytes of the input files.
Treat files with fewer than SIZE bytes as if they were empty. If Treat files with fewer than SIZE bytes as if they were empty. If SIZE
SIZE is in the form 'SIZE1:SIZE2', ignore the first SIZE1 bytes of is in the form 'SIZE1:SIZE2', ignore the first SIZE1 bytes of the
the first input file and the first SIZE2 bytes of the second input first input file and the first SIZE2 bytes of the second input file.
file.
'-l' '-l'
'-v' '-v'
'--list' '--list'
'--verbose' '--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.
'-n COUNT' '-n COUNT'
'--bytes=COUNT' '--bytes=COUNT'
Compare at most COUNT input bytes. Compare at most COUNT input bytes.
'-O [FORMAT1][,FORMAT2]' '-O [FORMAT1][,FORMAT2]'
'--force-format=[FORMAT1][,FORMAT2]' '--force-format=[FORMAT1][,FORMAT2]'
Force the given compression formats. Any of FORMAT1 or FORMAT2 may Force the compressed formats given. Any of FORMAT1 or FORMAT2 may be
be omitted and the corresponding format will be automatically omitted and the corresponding format will be automatically detected.
detected. Valid values for FORMAT are 'bz2', 'gz', 'lz' and 'xz'. Valid values for FORMAT are 'bz2', 'gz', 'lz', and 'xz'. If at least
If at least one format is specified with this option, the file is one format is specified with this option, the file is passed to the
passed to the corresponding decompressor without verifying its corresponding decompressor without verifying its format, and the exact
format, and the exact file names of both FILE1 and FILE2 must be file names of both FILE1 and FILE2 must be given. Other names won't be
given. Other names won't be tried. tried.
'-q' '-q'
'-s' '-s'
'--quiet' '--quiet'
'--silent' '--silent'
Don't print anything; only return an exit status indicating Don't print anything; only return an exit status indicating whether the
whether the files differ. files differ.
File: zutils.info, Node: Zdiff, Next: Zgrep, Prev: Zcmp, Up: Top File: zutils.info, Node: Zdiff, Next: Zgrep, Prev: Zcmp, Up: Top
6 Zdiff 6 Zdiff
******* *******
zdiff compares two files ('-' 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 '-' used as a FILE argument means
compressed, its decompressed content is used. zdiff is a front end to standard input. If any file given is compressed, its decompressed content
the diff program and has the limitation that messages from diff refer to is used. zdiff is a front end to the program diff and has the limitation
temporary file names instead of those specified. 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:
zdiff [OPTIONS] FILE1 [FILE2] zdiff [OPTIONS] FILE1 [FILE2]
This compares FILE1 to FILE2. If FILE2 is omitted zdiff tries the This compares FILE1 to FILE2. The standard input is used only if FILE1 or
FILE2 refers to standard input. If FILE2 is omitted zdiff tries the
following: following:
1. If FILE1 is compressed, compares its decompressed contents with - If FILE1 is compressed, compares its decompressed contents with the
the corresponding uncompressed file (the name of FILE1 with the corresponding uncompressed file (the name of FILE1 with the extension
extension removed). removed).
2. If FILE1 is uncompressed, compares it with the decompressed - If FILE1 is uncompressed, compares it with the decompressed contents
contents of FILE1.[lz|bz2|gz|xz] (the first one that is found). of FILE1.[lz|bz2|gz|xz] (the first one that is found).
3. If no suitable file is found, compares FILE1 with data read from
standard input.
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 zdiff supports the following options (some options only work if the diff
diff program used supports them): program used supports them):
'-a' '-a'
'--text' '--text'
Treat all files as text. Treat all files as text.
'-b' '-b'
'--ignore-space-change' '--ignore-space-change'
Ignore changes in the amount of white space. Ignore changes in the amount of white space.
'-B' '-B'
skipping to change at line 404 skipping to change at line 402
'-E' '-E'
'--ignore-tab-expansion' '--ignore-tab-expansion'
Ignore changes due to tab expansion. Ignore changes due to tab expansion.
'-i' '-i'
'--ignore-case' '--ignore-case'
Ignore case differences in file contents. Ignore case differences in file contents.
'-O [FORMAT1][,FORMAT2]' '-O [FORMAT1][,FORMAT2]'
'--force-format=[FORMAT1][,FORMAT2]' '--force-format=[FORMAT1][,FORMAT2]'
Force the given compression formats. Any of FORMAT1 or FORMAT2 may Force the compressed formats given. Any of FORMAT1 or FORMAT2 may be
be omitted and the corresponding format will be automatically omitted and the corresponding format will be automatically detected.
detected. Valid values for FORMAT are 'bz2', 'gz', 'lz' and 'xz'. Valid values for FORMAT are 'bz2', 'gz', 'lz', and 'xz'. If at least
If at least one format is specified with this option, the file is one format is specified with this option, the file is passed to the
passed to the corresponding decompressor without verifying its corresponding decompressor without verifying its format, and the exact
format, and the exact file names of both FILE1 and FILE2 must be file names of both FILE1 and FILE2 must be given. Other names won't be
given. Other names won't be tried. tried.
'-p' '-p'
'--show-c-function' '--show-c-function'
Show which C function each change is in. Show which C function each change is in.
'-q' '-q'
'--brief' '--brief'
Output only whether files differ. Output only whether files differ.
'-s' '-s'
skipping to change at line 448 skipping to change at line 446
'-w' '-w'
'--ignore-all-space' '--ignore-all-space'
Ignore all white space. Ignore all white space.
File: zutils.info, Node: Zgrep, Next: Ztest, Prev: Zdiff, Up: Top File: zutils.info, Node: Zgrep, Next: Ztest, Prev: Zdiff, Up: Top
7 Zgrep 7 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
on any combination of compressed and uncompressed files. If any given any combination of compressed and uncompressed files. If any file given is
file is compressed, its decompressed content is used. If a given file compressed, its decompressed content is used. If a file given does not
does not exist, and its name does not end with one of the known exist, and its name does not end with one of the known extensions, zgrep
extensions, zgrep tries the compressed file names corresponding to the tries the compressed file names corresponding to the formats supported. If
formats supported. If a file fails to decompress, zgrep continues 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 '-', data are read from standard input, If a file is specified as '-', 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
must be of the same type; all uncompressed or all in the same be of the same type; all uncompressed or all in the same compressed format.
compression 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:
zgrep [OPTIONS] PATTERN [FILES] zgrep [OPTIONS] PATTERN [FILES]
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
matches were found, and 2 means trouble. were found, and 2 means trouble.
zgrep supports the following options (some options only work if the zgrep supports the following options (some options only work if the grep
grep program used supports them): program used supports them):
'-a' '-a'
'--text' '--text'
Treat all files as text. Treat all files as text.
'-A N' '-A N'
'--after-context=N' '--after-context=N'
Print N lines of trailing context. Print N lines of trailing context.
'-b' '-b'
skipping to change at line 499 skipping to change at line 495
'-c' '-c'
'--count' '--count'
Only print a count of matching lines per file. Only print a count of matching lines per file.
'-C N' '-C N'
'--context=N' '--context=N'
Print N lines of output context. Print N lines of output context.
'--color[=WHEN]' '--color[=WHEN]'
Show matched strings in color. WHEN is 'never', 'always' or 'auto'. Show matched strings in color. WHEN is 'never', 'always', or 'auto'.
'-e PATTERN' '-e PATTERN'
'--regexp=PATTERN' '--regexp=PATTERN'
Use PATTERN as the pattern to match. Use PATTERN as the pattern to match.
'-E' '-E'
'--extended-regexp' '--extended-regexp'
Treat PATTERN as an extended regular expression. Treat PATTERN as an extended regular expression.
'-f FILE' '-f FILE'
'--file=FILE' '--file=FILE'
Obtain patterns from FILE, one per line. Obtain patterns from FILE, one per line.
When searching in several files at once, command substitution can When searching in several files at once, command substitution can be
be used with '-e' to read FILE only once, for example if FILE is used with '-e' to read FILE only once, for example if FILE is not a
not a regular file: 'zgrep -e "$(cat FILE)" file1.lz file2.gz' regular file: 'zgrep -e "$(cat FILE)" file1.lz file2.gz'
'-F' '-F'
'--fixed-strings' '--fixed-strings'
Treat PATTERN as a set of newline-separated strings. Treat PATTERN as a set of newline-separated strings.
'-h' '-h'
'--no-filename' '--no-filename'
Suppress the prefixing of file names on output when multiple files Suppress the prefixing of file names on output when multiple files are
are searched. searched.
'-H' '-H'
'--with-filename' '--with-filename'
Print the file name for each match. Print the file name for each match.
'-i' '-i'
'--ignore-case' '--ignore-case'
Ignore case distinctions. Ignore case distinctions.
'-I' '-I'
skipping to change at line 558 skipping to change at line 554
'-n' '-n'
'--line-number' '--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.
'-o' '-o'
'--only-matching' '--only-matching'
Show only the part of matching lines that actually matches PATTERN. Show only the part of matching lines that actually matches PATTERN.
'-O FORMAT' '-O FORMAT'
'--force-format=FORMAT' '--force-format=FORMAT'
Force the given compression format. Valid values for FORMAT are Force the compressed format given. Valid values for FORMAT are 'bz2',
'bz2', 'gz', 'lz' and 'xz'. If this option is used, the files are 'gz', 'lz', and 'xz'. If this option is used, the files are passed to
passed to the corresponding decompressor without verifying their the corresponding decompressor without verifying their format, and the
format, and the exact file name must be given. Other names won't exact file name must be given. Other names won't be tried.
be tried.
'-q' '-q'
'--quiet' '--quiet'
Suppress all messages. Exit immediately with zero status if any Suppress all messages. Exit immediately with zero status if any match
match is found, even if an error was detected. is found, even if an error was detected.
'-r' '-r'
'--recursive' '--recursive'
For each directory operand, read and process all files in that For each directory operand, read and process all files in that
directory, recursively. Follow symbolic links in the command line, directory, recursively. Follow symbolic links given in the command
but skip symlinks that are encountered recursively. line, but skip symbolic links that are encountered recursively.
'-R' '-R'
'--dereference-recursive' '--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, recursively, following all symbolic links. directory, recursively, following all symbolic links.
'-s' '-s'
'--no-messages' '--no-messages'
Suppress error messages about nonexistent or unreadable files. Suppress error messages about nonexistent or unreadable files.
skipping to change at line 604 skipping to change at line 599
'-x' '-x'
'--line-regexp' '--line-regexp'
Match only whole lines. Match only whole lines.
File: zutils.info, Node: Ztest, Next: Zupdate, Prev: Zgrep, Up: Top File: zutils.info, Node: Ztest, Next: Zupdate, Prev: Zgrep, Up: Top
8 Ztest 8 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 '-', the Uncompressed files are ignored. If a file is specified as '-', 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
a file fails to decompress, ztest continues verifying the rest of the 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
verify the integrity of all xz files. Third, section 2.1.1.2 'Stream verify the integrity of all xz files. Third, section 2.1.1.2 'Stream Flags'
Flags' of the xz format specification allows xz decompressors to of the xz format specification allows xz decompressors to produce garbage
produce garbage output without issuing any warning. Therefore, xz files output without issuing any warning. Therefore, xz files can't always be
can't always be verified as reliably as files in the other formats can. verified as reliably as files in the other formats can.
The format for running ztest is: The format for running ztest is:
ztest [OPTIONS] [FILES] ztest [OPTIONS] [FILES]
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
environmental problems (file not found, invalid flags, I/O errors, etc), problems (file not found, invalid flags, I/O errors, etc), 2 if any
2 if any compressed file is corrupt or invalid. compressed file is corrupt or invalid.
ztest supports the following options: ztest supports the following options:
'-O FORMAT' '-O FORMAT'
'--force-format=FORMAT' '--force-format=FORMAT'
Force the given compression format. Valid values for FORMAT are Force the compressed format given. Valid values for FORMAT are 'bz2',
'bz2', 'gz', 'lz' and 'xz'. If this option is used, the files are 'gz', 'lz', and 'xz'. If this option is used, the files are passed to
passed to the corresponding decompressor without verifying their the corresponding decompressor without verifying their format, and any
format, and any files in a format that the decompressor can't files in a format that the decompressor can't understand will fail.
understand will fail. For example, '--force-format=gz' can test For example, '--force-format=gz' can test gzipped (.gz) and compress'd
gzipped (.gz) and compress'd (.Z) files if the compressor used is (.Z) files if the compressor used is GNU gzip.
GNU gzip.
'-q' '-q'
'--quiet' '--quiet'
Quiet operation. Suppress all messages. Quiet operation. Suppress all messages.
'-r' '-r'
'--recursive' '--recursive'
For each directory operand, read and process all files in that For each directory operand, read and process all files in that
directory, recursively. Follow symbolic links in the command line, directory, recursively. Follow symbolic links given in the command
but skip symlinks that are encountered recursively. line, but skip symbolic links that are encountered recursively.
'-R' '-R'
'--dereference-recursive' '--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, recursively, following all symbolic links. directory, recursively, following all symbolic links.
'-v' '-v'
'--verbose' '--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.
File: zutils.info, Node: Zupdate, Next: Problems, Prev: Ztest, Up: Top File: zutils.info, Node: Zupdate, Next: Problems, Prev: Ztest, Up: Top
9 Zupdate 9 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 '--force' option is given. In this case, if the skipped unless the option '--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
and the original file is not deleted. The operation of zupdate is meant the original file is not deleted. The operation of zupdate is meant to be
to be safe and not produce any data loss. Therefore, existing lzip safe and not cause any data loss. Therefore, existing lzip compressed files
compressed files are never overwritten nor deleted. are never overwritten nor deleted.
Combining the '--force' and '--keep' options, as in Combining the options '--force' and '--keep', as in
'zupdate -f -k *.gz', verifies that there are no differences between 'zupdate -f -k *.gz', verifies that there are no differences between each
each pair of files in a multiformat set of files. 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: '.bz2', '.tbz', '.tbz2', '.gz', '.tgz', '.xz', '.txz'. The extensions:
files produced have the extensions '.lz' or '.tar.lz'. '.bz2', '.gz', and '.xz' are recompressed to '.lz'.
'.tbz', '.tbz2', '.tgz', and '.txz' are recompressed to '.tlz'.
Recompressing a file is much like copying or moving it; therefore Keeping the combined extensions ('.tgz' -> '.tlz') may be useful when
zupdate preserves the access and modification dates, permissions, and, recompressing Slackware packages, for example.
when possible, ownership of the file just as 'cp -p' does. (If the user
ID or the group ID can't be duplicated, the file permission bits S_ISUID Recompressing a file is much like copying or moving it; therefore zupdate
and S_ISGID are cleared). preserves the access and modification dates, permissions, and, when
possible, ownership of the file just as '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:
zupdate [OPTIONS] [FILES] zupdate [OPTIONS] [FILES]
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:
'-f' '-f'
'--force' '--force'
Don't skip a file for which a lzip compressed version already Don't skip a file for which a lzip compressed version already exists.
exists. '--force' compares the content of the input file with the '--force' compares the content of the input file with the content of
content of the existing lzip file and deletes the input file if the existing lzip file and deletes the input file if both contents are
both contents are identical. identical.
'-k' '-k'
'--keep' '--keep'
Keep (don't delete) the input file after comparing it with the Keep (don't delete) the input file after comparing it with the lzip
lzip file. file.
'-l' '-l'
'--lzip-verbose' '--lzip-verbose'
Pass a '-v' option to the lzip compressor so that it shows the Pass one option '-v' to the lzip compressor so that it shows the
compression ratio for each file processed. Using lzip 1.15 and compression ratio for each file processed. Using lzip 1.15 or newer, a
newer, a second '-l' shows the progress of compression. Use it second '-l' shows the progress of compression. Use it together with
together with '-v' to see the name of the file. '-v' to see the name of the file.
'-q' '-q'
'--quiet' '--quiet'
Quiet operation. Suppress all messages. Quiet operation. Suppress all messages.
'-r' '-r'
'--recursive' '--recursive'
For each directory operand, read and process all files in that For each directory operand, read and process all files in that
directory, recursively. Follow symbolic links in the command line, directory, recursively. Follow symbolic links given in the command
but skip symlinks that are encountered recursively. line, but skip symbolic links that are encountered recursively.
'-R' '-R'
'--dereference-recursive' '--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, recursively, following all symbolic links. directory, recursively, following all symbolic links.
'-v' '-v'
'--verbose' '--verbose'
Verbose mode. Show the files being processed. A second '-v' also Verbose mode. Show the files being processed. A second '-v' also shows
shows the files being ignored. the files being ignored.
'-0 .. -9' '-0 .. -9'
Set the compression level of lzip. By default zupdate passes '-9' Set the compression level of lzip. By default zupdate passes '-9' to
to lzip. lzip. Custom compression options can be passed to lzip with the option
'--lz'. For example '--lz='lzip -9 -s64MiB''.
File: zutils.info, Node: Problems, Next: Concept index, Prev: Zupdate, Up: T op File: zutils.info, Node: Problems, Next: Concept index, Prev: Zupdate, Up: T op
10 Reporting bugs 10 Reporting bugs
***************** *****************
There are probably bugs in zutils. There are certainly errors and There are probably bugs in zutils. There are certainly errors and omissions
omissions in this manual. If you report them, they will get fixed. If in this manual. If you report them, they will get fixed. If you don't, no
you don't, no one will ever know about them and they will remain unfixed one will ever know about them and they will remain unfixed for all
for all eternity, if not longer. 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
<zutils-bug@nongnu.org>. Include the version number, which you can find <zutils-bug@nongnu.org>. Include the version number, which you can find by
by running 'zupdate --version'. running 'zupdate --version'.
File: zutils.info, Node: Concept index, Prev: Problems, Up: Top File: zutils.info, Node: Concept index, Prev: Problems, Up: Top
Concept index Concept index
************* *************
* Menu: * Menu:
* bugs: Problems. (line 6) * bugs: Problems. (line 6)
* common options: Common options. (line 6) * common options: Common options. (line 6)
* getting help: Problems. (line 6) * getting help: Problems. (line 6)
* introduction: Introduction. (line 6) * introduction: Introduction. (line 6)
* the zutilsrc file: The zutilsrc file. (line 6) * the zutilsrc file: The zutilsrc file. (line 6)
* zcat: Zcat. (line 6) * zcat: Zcat. (line 6)
* zcmp: Zcmp. (line 6) * zcmp: Zcmp. (line 6)
* zdiff: Zdiff. (line 6) * zdiff: Zdiff. (line 6)
* zgrep: Zgrep. (line 6) * zgrep: Zgrep. (line 6)
* ztest: Ztest. (line 6) * ztest: Ztest. (line 6)
* zupdate: Zupdate. (line 6) * zupdate: Zupdate. (line 6)
 End of changes. 71 change blocks. 
251 lines changed or deleted 249 lines changed or added

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