2025-02-24 04:42:45 +01:00
|
|
|
\input texinfo @c -*-texinfo-*-
|
|
|
|
@c %**start of header
|
|
|
|
@setfilename zutils.info
|
2025-02-24 05:40:39 +01:00
|
|
|
@documentencoding ISO-8859-15
|
2025-02-24 04:58:36 +01:00
|
|
|
@settitle Zutils Manual
|
2025-02-24 04:42:45 +01:00
|
|
|
@finalout
|
|
|
|
@c %**end of header
|
|
|
|
|
2025-02-24 06:00:49 +01:00
|
|
|
@set UPDATED 25 January 2022
|
|
|
|
@set VERSION 1.11
|
2025-02-24 04:42:45 +01:00
|
|
|
|
2025-02-24 06:00:49 +01:00
|
|
|
@dircategory Compression
|
2025-02-24 04:42:45 +01:00
|
|
|
@direntry
|
|
|
|
* Zutils: (zutils). Utilities dealing with compressed files
|
|
|
|
@end direntry
|
|
|
|
|
|
|
|
|
2025-02-24 05:04:54 +01:00
|
|
|
@ifnothtml
|
2025-02-24 04:42:45 +01:00
|
|
|
@titlepage
|
|
|
|
@title Zutils
|
|
|
|
@subtitle Utilities dealing with compressed files
|
|
|
|
@subtitle for Zutils version @value{VERSION}, @value{UPDATED}
|
|
|
|
@author by Antonio Diaz Diaz
|
|
|
|
|
|
|
|
@page
|
|
|
|
@vskip 0pt plus 1filll
|
|
|
|
@end titlepage
|
|
|
|
|
|
|
|
@contents
|
2025-02-24 05:01:08 +01:00
|
|
|
@end ifnothtml
|
2025-02-24 04:42:45 +01:00
|
|
|
|
2025-02-24 05:59:59 +01:00
|
|
|
@ifnottex
|
2025-02-24 04:42:45 +01:00
|
|
|
@node Top
|
|
|
|
@top
|
|
|
|
|
|
|
|
This manual is for Zutils (version @value{VERSION}, @value{UPDATED}).
|
|
|
|
|
|
|
|
@menu
|
2025-02-24 05:01:08 +01:00
|
|
|
* Introduction:: Purpose and features of zutils
|
2025-02-24 05:51:09 +01:00
|
|
|
* Common options:: Options common to all utilities
|
2025-02-24 05:43:00 +01:00
|
|
|
* The zutilsrc file:: The zutils configuration file
|
2025-02-24 05:01:08 +01:00
|
|
|
* Zcat:: Concatenating compressed files
|
|
|
|
* Zcmp:: Comparing compressed files byte by byte
|
|
|
|
* Zdiff:: Comparing compressed files line by line
|
|
|
|
* Zgrep:: Searching inside compressed files
|
2025-02-24 05:54:33 +01:00
|
|
|
* Ztest:: Testing the integrity of compressed files
|
2025-02-24 05:45:13 +01:00
|
|
|
* Zupdate:: Recompressing files to lzip format
|
2025-02-24 05:01:08 +01:00
|
|
|
* Problems:: Reporting bugs
|
2025-02-24 05:43:00 +01:00
|
|
|
* Concept index:: Index of concepts
|
2025-02-24 04:42:45 +01:00
|
|
|
@end menu
|
|
|
|
|
|
|
|
@sp 1
|
2025-02-24 06:00:49 +01:00
|
|
|
Copyright @copyright{} 2009-2022 Antonio Diaz Diaz.
|
2025-02-24 04:42:45 +01:00
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
This manual is free documentation: you have unlimited permission to copy,
|
|
|
|
distribute, and modify it.
|
2025-02-24 05:59:59 +01:00
|
|
|
@end ifnottex
|
2025-02-24 04:42:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
@node Introduction
|
|
|
|
@chapter Introduction
|
|
|
|
@cindex introduction
|
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
@uref{http://www.nongnu.org/zutils/zutils.html,,Zutils}
|
|
|
|
is a collection of utilities able to process any combination of
|
|
|
|
compressed and uncompressed files transparently. If any file given,
|
|
|
|
including standard input, is compressed, its decompressed content is used.
|
|
|
|
Compressed files are decompressed on the fly; no temporary files are
|
|
|
|
created.
|
2025-02-24 05:40:39 +01:00
|
|
|
|
|
|
|
These utilities are not wrapper scripts but safer and more efficient C++
|
2025-02-24 05:59:17 +01:00
|
|
|
programs. In particular the option @samp{--recursive} is very efficient in
|
|
|
|
those utilities supporting it.
|
2025-02-24 04:42:45 +01:00
|
|
|
|
2025-02-24 05:01:08 +01:00
|
|
|
@noindent
|
2025-02-24 05:59:17 +01:00
|
|
|
The utilities provided are zcat, zcmp, zdiff, zgrep, ztest, and zupdate.@*
|
2025-02-24 06:00:49 +01:00
|
|
|
The formats supported are bzip2, gzip, lzip, xz, and zstd.@*
|
2025-02-24 05:59:17 +01:00
|
|
|
Zutils uses external compressors. The compressor to be used for each format
|
|
|
|
is configurable at runtime.
|
|
|
|
|
|
|
|
zcat, zcmp, zdiff, and zgrep are improved replacements for the shell scripts
|
|
|
|
provided by GNU gzip. ztest is unique to zutils. zupdate is similar to
|
|
|
|
gzip's znew.
|
|
|
|
|
|
|
|
NOTE: Bzip2 and lzip provide well-defined values of exit status, which makes
|
|
|
|
them safe to use with zutils. Gzip and xz may return ambiguous warning
|
2025-02-24 06:00:49 +01:00
|
|
|
values, making them less reliable back ends for zutils. Zstd currently does
|
|
|
|
not even document its exit status in its man page.
|
2025-02-24 05:51:09 +01:00
|
|
|
@xref{compressor-requirements}.
|
2025-02-24 05:42:28 +01:00
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
FORMAT NOTE 1: The option @samp{--format} allows the processing of a subset
|
2025-02-24 06:00:49 +01:00
|
|
|
of formats in recursive mode and when trying compressed file names. For
|
|
|
|
example, use the following command to search for the string @samp{foo} in
|
|
|
|
gzip and lzip files only:
|
|
|
|
@w{@samp{zgrep foo -r --format=gz,lz somedir somefile.tar}}.
|
2025-02-24 05:51:09 +01:00
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
FORMAT NOTE 2: If the option @samp{--force-format} is given, the files are
|
|
|
|
passed to the corresponding decompressor without verifying their format,
|
|
|
|
allowing for example the processing of compress'd (.Z) files with gzip:
|
|
|
|
@w{@samp{zcmp --force-format=gz file.Z file.lz}}.
|
2025-02-24 05:48:48 +01:00
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
LANGUAGE NOTE: Uncompressed = not compressed = plain data; it may never have
|
|
|
|
been compressed. Decompressed is used to refer to data which have undergone
|
|
|
|
the process of decompression.
|
2025-02-24 05:43:00 +01:00
|
|
|
|
2025-02-24 05:01:08 +01:00
|
|
|
@sp 1
|
|
|
|
Numbers given as arguments to options (positions, sizes) may be followed
|
|
|
|
by a multiplier and an optional @samp{B} for "byte".
|
|
|
|
|
|
|
|
Table of SI and binary prefixes (unit multipliers):
|
|
|
|
|
|
|
|
@multitable {Prefix} {kilobyte (10^3 = 1000)} {|} {Prefix} {kibibyte (2^10 = 1024)}
|
|
|
|
@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 M @tab megabyte (10^6) @tab | @tab Mi @tab mebibyte (2^20)
|
|
|
|
@item G @tab gigabyte (10^9) @tab | @tab Gi @tab gibibyte (2^30)
|
|
|
|
@item T @tab terabyte (10^12) @tab | @tab Ti @tab tebibyte (2^40)
|
|
|
|
@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 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)
|
|
|
|
@end multitable
|
2025-02-24 04:42:45 +01:00
|
|
|
|
|
|
|
|
2025-02-24 05:43:00 +01:00
|
|
|
@node Common options
|
|
|
|
@chapter Common options
|
|
|
|
@cindex common options
|
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
The following
|
|
|
|
@uref{http://www.nongnu.org/arg-parser/manual/arg_parser_manual.html#Argument-syntax,,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
|
2025-02-24 05:43:00 +01:00
|
|
|
|
2025-02-24 05:52:24 +01:00
|
|
|
@table @code
|
2025-02-24 05:43:00 +01:00
|
|
|
@item -h
|
|
|
|
@itemx --help
|
2025-02-24 05:52:24 +01:00
|
|
|
Print an informative help message describing the options and exit. zgrep
|
2025-02-24 05:43:00 +01:00
|
|
|
only supports the @samp{--help} form of this option.
|
|
|
|
|
|
|
|
@item -V
|
|
|
|
@itemx --version
|
|
|
|
Print the version number on the standard output and exit.
|
2025-02-24 05:57:59 +01:00
|
|
|
This version number should be included in all bug reports.
|
2025-02-24 06:00:49 +01:00
|
|
|
In verbose mode, zdiff and zgrep print also the version of the diff or grep
|
|
|
|
program used respectively.
|
2025-02-24 05:43:00 +01:00
|
|
|
|
2025-02-24 05:51:09 +01:00
|
|
|
@item -M @var{format_list}
|
|
|
|
@itemx --format=@var{format_list}
|
2025-02-24 06:00:49 +01:00
|
|
|
Process only the formats listed in the comma-separated @var{format_list}.
|
|
|
|
Valid formats are @samp{bz2}, @samp{gz}, @samp{lz}, @samp{xz}, @samp{zst},
|
|
|
|
and @samp{un} for @samp{uncompressed}, meaning "any file name without a
|
|
|
|
known extension". This option excludes files based on extension, instead of
|
|
|
|
format, because it is more efficient. The exclusion only applies to names
|
|
|
|
generated automatically (for example when adding extensions to a file name
|
|
|
|
or when operating recursively on directories). Files given in the command
|
|
|
|
line are always processed.
|
2025-02-24 05:51:09 +01:00
|
|
|
|
|
|
|
Each format in @var{format_list} enables file names with the following
|
|
|
|
extensions:
|
|
|
|
|
|
|
|
@multitable {bz2} {enables} {any other file name}
|
|
|
|
@item bz2 @tab enables @tab .bz2 .tbz .tbz2
|
|
|
|
@item gz @tab enables @tab .gz .tgz
|
|
|
|
@item lz @tab enables @tab .lz .tlz
|
|
|
|
@item xz @tab enables @tab .xz .txz
|
2025-02-24 06:00:49 +01:00
|
|
|
@item zst @tab enables @tab .zst .tzst
|
2025-02-24 05:51:09 +01:00
|
|
|
@item un @tab enables @tab any other file name
|
|
|
|
@end multitable
|
|
|
|
|
2025-02-24 05:43:00 +01:00
|
|
|
@item -N
|
|
|
|
@itemx --no-rcfile
|
|
|
|
Don't read the runtime configuration file @samp{zutilsrc}.
|
|
|
|
|
|
|
|
@item --bz2=@var{command}
|
|
|
|
@itemx --gz=@var{command}
|
|
|
|
@itemx --lz=@var{command}
|
|
|
|
@itemx --xz=@var{command}
|
2025-02-24 06:00:49 +01:00
|
|
|
@itemx --zst=@var{command}
|
2025-02-24 05:59:17 +01:00
|
|
|
Set program to be used as (de)compressor for the corresponding format.
|
|
|
|
@var{command} may include arguments. For example
|
|
|
|
@w{@samp{--lz='plzip --threads=2'}}. The program set with @samp{--lz} is
|
2025-02-24 06:00:49 +01:00
|
|
|
used for both compression and decompression. The others are used only for
|
|
|
|
decompression. The name of the program can't begin with @samp{-}. These
|
2025-02-24 05:59:17 +01:00
|
|
|
options override the values set in @file{zutilsrc}. The compression program
|
|
|
|
used must meet three requirements:
|
2025-02-24 05:43:00 +01:00
|
|
|
|
2025-02-24 05:51:09 +01:00
|
|
|
@anchor{compressor-requirements}
|
2025-02-24 05:43:00 +01:00
|
|
|
@enumerate
|
|
|
|
@item
|
2025-02-24 06:00:49 +01:00
|
|
|
When called with the option @samp{-d} and without file names, it must read
|
|
|
|
compressed data from the standard input and produce decompressed data on the
|
|
|
|
standard output.
|
2025-02-24 05:43:00 +01:00
|
|
|
@item
|
2025-02-24 05:59:17 +01:00
|
|
|
If the option @samp{-q} is passed to zutils, the compression program must
|
|
|
|
also accept it.
|
2025-02-24 05:43:00 +01:00
|
|
|
@item
|
|
|
|
It must return 0 if no errors occurred, and a non-zero value otherwise.
|
|
|
|
@end enumerate
|
|
|
|
|
|
|
|
@end table
|
|
|
|
|
|
|
|
|
|
|
|
@node The zutilsrc file
|
2025-02-24 05:59:59 +01:00
|
|
|
@chapter The zutils configuration file 'zutilsrc'
|
|
|
|
@cindex zutilsrc
|
2025-02-24 05:43:00 +01:00
|
|
|
|
|
|
|
@file{zutilsrc} is the runtime configuration file for zutils. In it you
|
|
|
|
may define the compressor name and options to be used for each format.
|
2025-02-24 05:59:59 +01:00
|
|
|
@file{zutilsrc} is optional; you don't need to install it in order to run
|
|
|
|
zutils.
|
2025-02-24 05:43:00 +01:00
|
|
|
|
|
|
|
The compressors specified in the command line override those specified
|
2025-02-24 05:59:59 +01:00
|
|
|
in @file{zutilsrc}.
|
2025-02-24 05:43:00 +01:00
|
|
|
|
2025-02-24 05:59:59 +01:00
|
|
|
You may copy the system @file{zutilsrc} file @file{$@{sysconfdir@}/zutilsrc}
|
|
|
|
to @file{$HOME/.zutilsrc} and customize these options as you like. The file
|
|
|
|
syntax is fairly obvious (and there are further instructions in it):
|
2025-02-24 05:43:00 +01:00
|
|
|
|
|
|
|
@enumerate
|
|
|
|
@item
|
|
|
|
Any line beginning with @samp{#} is a comment line.
|
|
|
|
@item
|
2025-02-24 05:59:17 +01:00
|
|
|
Each non-comment line defines the command to be used for the corresponding
|
2025-02-24 05:43:00 +01:00
|
|
|
format, with the syntax:
|
|
|
|
@example
|
|
|
|
<format> = <compressor> [options]
|
|
|
|
@end example
|
2025-02-24 06:00:49 +01:00
|
|
|
where <format> is one of @samp{bz2}, @samp{gz}, @samp{lz}, @samp{xz}, or
|
|
|
|
@samp{zst}.
|
2025-02-24 05:43:00 +01:00
|
|
|
@end enumerate
|
|
|
|
|
2025-02-24 05:44:16 +01:00
|
|
|
|
2025-02-24 04:42:45 +01:00
|
|
|
@node Zcat
|
|
|
|
@chapter Zcat
|
|
|
|
@cindex zcat
|
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
zcat copies each @var{file} argument to standard output in sequence. If any
|
|
|
|
file given is compressed, its decompressed content is copied. If a file
|
|
|
|
given does not exist, and its name does not end with one of the known
|
|
|
|
extensions, zcat tries the compressed file names corresponding to the
|
|
|
|
formats supported. If a file fails to decompress, zcat continues copying the
|
|
|
|
rest of the files.
|
2025-02-24 05:40:39 +01:00
|
|
|
|
2025-02-24 05:57:59 +01:00
|
|
|
If a file is specified as @samp{-}, data are read from standard input,
|
|
|
|
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
|
2025-02-24 05:59:17 +01:00
|
|
|
same compressed format.
|
2025-02-24 05:57:59 +01:00
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
If no files are specified, recursive searches examine the current working
|
|
|
|
directory, and nonrecursive searches read standard input.
|
2025-02-24 04:42:45 +01:00
|
|
|
|
|
|
|
The format for running zcat is:
|
|
|
|
|
|
|
|
@example
|
2025-02-24 05:01:08 +01:00
|
|
|
zcat [@var{options}] [@var{files}]
|
2025-02-24 04:42:45 +01:00
|
|
|
@end example
|
|
|
|
|
|
|
|
@noindent
|
2025-02-24 05:59:17 +01:00
|
|
|
Exit status is 0 if no errors occurred, 1 otherwise.
|
2025-02-24 04:42:45 +01:00
|
|
|
|
2025-02-24 05:52:24 +01:00
|
|
|
zcat supports the following options:
|
2025-02-24 04:42:45 +01:00
|
|
|
|
2025-02-24 05:52:24 +01:00
|
|
|
@table @code
|
2025-02-24 05:01:08 +01:00
|
|
|
@item -A
|
|
|
|
@itemx --show-all
|
|
|
|
Equivalent to @samp{-vET}.
|
|
|
|
|
|
|
|
@item -b
|
|
|
|
@itemx --number-nonblank
|
|
|
|
Number all nonblank output lines, starting with 1. The line count is
|
|
|
|
unlimited.
|
|
|
|
|
|
|
|
@item -e
|
|
|
|
Equivalent to @samp{-vE}.
|
|
|
|
|
|
|
|
@item -E
|
|
|
|
@itemx --show-ends
|
|
|
|
Print a @samp{$} after the end of each line.
|
|
|
|
|
|
|
|
@item -n
|
|
|
|
@itemx --number
|
|
|
|
Number all output lines, starting with 1. The line count is unlimited.
|
|
|
|
|
2025-02-24 05:51:09 +01:00
|
|
|
@item -O @var{format}
|
|
|
|
@itemx --force-format=@var{format}
|
2025-02-24 05:59:17 +01:00
|
|
|
Force the compressed format given. Valid values for @var{format} are
|
2025-02-24 06:00:49 +01:00
|
|
|
@samp{bz2}, @samp{gz}, @samp{lz}, @samp{xz}, and @samp{zst}. If this option
|
|
|
|
is used, the files are passed to the corresponding decompressor without
|
|
|
|
verifying their format, and the exact file name must be given. Other names
|
|
|
|
won't be tried.
|
2025-02-24 05:51:09 +01:00
|
|
|
|
2025-02-24 05:01:08 +01:00
|
|
|
@item -q
|
|
|
|
@itemx --quiet
|
|
|
|
Quiet operation. Suppress all messages.
|
|
|
|
|
|
|
|
@item -r
|
|
|
|
@itemx --recursive
|
2025-02-24 05:59:17 +01:00
|
|
|
For each directory operand, read and process all files in that directory,
|
|
|
|
recursively. Follow symbolic links given in the command line, but skip
|
|
|
|
symbolic links that are encountered recursively.
|
2025-02-24 05:57:59 +01:00
|
|
|
|
|
|
|
@item -R
|
|
|
|
@itemx --dereference-recursive
|
2025-02-24 05:59:17 +01:00
|
|
|
For each directory operand, read and process all files in that directory,
|
|
|
|
recursively, following all symbolic links.
|
2025-02-24 04:58:36 +01:00
|
|
|
|
2025-02-24 05:01:08 +01:00
|
|
|
@item -s
|
|
|
|
@itemx --squeeze-blank
|
|
|
|
Replace multiple adjacent blank lines with a single blank line.
|
|
|
|
|
|
|
|
@item -t
|
|
|
|
Equivalent to @samp{-vT}.
|
|
|
|
|
|
|
|
@item -T
|
|
|
|
@itemx --show-tabs
|
|
|
|
Print TAB characters as @samp{^I}.
|
|
|
|
|
|
|
|
@item -v
|
|
|
|
@itemx --show-nonprinting
|
|
|
|
Print control characters except for LF (newline) and TAB using @samp{^}
|
|
|
|
notation and precede characters larger than 127 with @samp{M-} (which
|
|
|
|
stands for "meta").
|
|
|
|
|
|
|
|
@item --verbose
|
|
|
|
Verbose mode. Show error messages.
|
|
|
|
|
2025-02-24 04:42:45 +01:00
|
|
|
@end table
|
|
|
|
|
|
|
|
|
2025-02-24 05:01:08 +01:00
|
|
|
@node Zcmp
|
|
|
|
@chapter Zcmp
|
2025-02-24 04:42:45 +01:00
|
|
|
@cindex zcmp
|
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
zcmp compares two files and, if they differ, writes to standard output the
|
|
|
|
first byte and line number where they differ. Bytes and lines are numbered
|
|
|
|
starting with 1. A hyphen @samp{-} used as a @var{file} argument means
|
|
|
|
standard input. If any file given is compressed, its decompressed content is
|
|
|
|
used. Compressed files are decompressed on the fly; no temporary files are
|
|
|
|
created.
|
2025-02-24 05:01:08 +01:00
|
|
|
|
|
|
|
The format for running zcmp is:
|
|
|
|
|
|
|
|
@example
|
|
|
|
zcmp [@var{options}] @var{file1} [@var{file2}]
|
|
|
|
@end example
|
|
|
|
|
|
|
|
@noindent
|
2025-02-24 05:59:17 +01:00
|
|
|
This compares @var{file1} to @var{file2}. The standard input is used only if
|
|
|
|
@var{file1} or @var{file2} refers to standard input. If @var{file2} is
|
|
|
|
omitted zcmp tries the following:
|
2025-02-24 05:40:39 +01:00
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
@itemize -
|
2025-02-24 05:40:39 +01:00
|
|
|
@item
|
2025-02-24 05:43:00 +01:00
|
|
|
If @var{file1} is compressed, compares its decompressed contents with
|
|
|
|
the corresponding uncompressed file (the name of @var{file1} with the
|
|
|
|
extension removed).
|
2025-02-24 05:40:39 +01:00
|
|
|
@item
|
2025-02-24 05:43:00 +01:00
|
|
|
If @var{file1} is uncompressed, compares it with the decompressed
|
2025-02-24 06:00:49 +01:00
|
|
|
contents of @var{file1}.[lz|bz2|gz|zst|xz] (the first one that is found).
|
2025-02-24 05:59:17 +01:00
|
|
|
@end itemize
|
2025-02-24 04:42:45 +01:00
|
|
|
|
|
|
|
@noindent
|
2025-02-24 05:01:08 +01:00
|
|
|
An exit status of 0 means no differences were found, 1 means some
|
|
|
|
differences were found, and 2 means trouble.
|
|
|
|
|
2025-02-24 05:52:24 +01:00
|
|
|
zcmp supports the following options:
|
2025-02-24 05:01:08 +01:00
|
|
|
|
2025-02-24 05:52:24 +01:00
|
|
|
@table @code
|
2025-02-24 05:01:08 +01:00
|
|
|
@item -b
|
|
|
|
@itemx --print-bytes
|
|
|
|
Print the differing bytes. Print control bytes as a @samp{^} followed by
|
|
|
|
a letter, and precede bytes larger than 127 with @samp{M-} (which stands
|
|
|
|
for "meta").
|
|
|
|
|
|
|
|
@item -i @var{size}
|
|
|
|
@itemx --ignore-initial=@var{size}
|
|
|
|
Ignore any differences in the first @var{size} bytes of the input files.
|
|
|
|
Treat files with fewer than @var{size} bytes as if they were empty. If
|
2025-02-24 05:54:33 +01:00
|
|
|
@var{size} is in the form @samp{@var{size1}:@var{size2}}, ignore the
|
2025-02-24 05:01:08 +01:00
|
|
|
first @var{size1} bytes of the first input file and the first
|
|
|
|
@var{size2} bytes of the second input file.
|
|
|
|
|
|
|
|
@item -l
|
|
|
|
@itemx -v
|
|
|
|
@itemx --list
|
|
|
|
@itemx --verbose
|
|
|
|
Print the byte numbers (in decimal) and values (in octal) of all
|
|
|
|
differing bytes.
|
|
|
|
|
|
|
|
@item -n @var{count}
|
|
|
|
@itemx --bytes=@var{count}
|
|
|
|
Compare at most @var{count} input bytes.
|
|
|
|
|
2025-02-24 05:51:09 +01:00
|
|
|
@item -O [@var{format1}][,@var{format2}]
|
|
|
|
@itemx --force-format=[@var{format1}][,@var{format2}]
|
2025-02-24 06:00:49 +01:00
|
|
|
Force the compressed formats given. Any of @var{format1} or @var{format2}
|
|
|
|
may be omitted and the corresponding format will be automatically detected.
|
|
|
|
Valid values for @var{format} are @samp{bz2}, @samp{gz}, @samp{lz},
|
|
|
|
@samp{xz}, and @samp{zst}. If at least one format is specified with this
|
|
|
|
option, the file is passed to the corresponding decompressor 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.
|
2025-02-24 05:51:09 +01:00
|
|
|
|
2025-02-24 05:01:08 +01:00
|
|
|
@item -q
|
|
|
|
@itemx -s
|
|
|
|
@itemx --quiet
|
|
|
|
@itemx --silent
|
2025-02-24 05:53:08 +01:00
|
|
|
Don't print anything; only return an exit status indicating whether the
|
2025-02-24 05:01:08 +01:00
|
|
|
files differ.
|
|
|
|
|
|
|
|
@end table
|
|
|
|
|
|
|
|
|
|
|
|
@node Zdiff
|
|
|
|
@chapter Zdiff
|
|
|
|
@cindex zdiff
|
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
zdiff compares two files and, if they differ, writes to standard output the
|
|
|
|
differences line by line. A hyphen @samp{-} used as a @var{file} argument
|
|
|
|
means standard input. If any file given is compressed, its decompressed
|
|
|
|
content is used. zdiff is a front end to the program diff and has the
|
|
|
|
limitation that messages from diff refer to temporary file names instead of
|
|
|
|
those specified.
|
2025-02-24 04:42:45 +01:00
|
|
|
|
|
|
|
The format for running zdiff is:
|
|
|
|
|
|
|
|
@example
|
2025-02-24 05:01:08 +01:00
|
|
|
zdiff [@var{options}] @var{file1} [@var{file2}]
|
2025-02-24 04:42:45 +01:00
|
|
|
@end example
|
|
|
|
|
|
|
|
@noindent
|
2025-02-24 05:59:17 +01:00
|
|
|
This compares @var{file1} to @var{file2}. The standard input is used only if
|
|
|
|
@var{file1} or @var{file2} refers to standard input. If @var{file2} is
|
|
|
|
omitted zdiff tries the following:
|
2025-02-24 05:40:39 +01:00
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
@itemize -
|
2025-02-24 05:40:39 +01:00
|
|
|
@item
|
2025-02-24 05:43:00 +01:00
|
|
|
If @var{file1} is compressed, compares its decompressed contents with
|
|
|
|
the corresponding uncompressed file (the name of @var{file1} with the
|
|
|
|
extension removed).
|
2025-02-24 05:40:39 +01:00
|
|
|
@item
|
2025-02-24 05:43:00 +01:00
|
|
|
If @var{file1} is uncompressed, compares it with the decompressed
|
2025-02-24 06:00:49 +01:00
|
|
|
contents of @var{file1}.[lz|bz2|gz|zst|xz] (the first one that is found).
|
2025-02-24 05:59:17 +01:00
|
|
|
@end itemize
|
2025-02-24 05:01:08 +01:00
|
|
|
|
|
|
|
@noindent
|
|
|
|
An exit status of 0 means no differences were found, 1 means some
|
|
|
|
differences were found, and 2 means trouble.
|
2025-02-24 04:42:45 +01:00
|
|
|
|
2025-02-24 05:56:02 +01:00
|
|
|
zdiff supports the following options (some options only work if the diff
|
|
|
|
program used supports them):
|
2025-02-24 04:42:45 +01:00
|
|
|
|
2025-02-24 05:52:24 +01:00
|
|
|
@table @code
|
2025-02-24 05:01:08 +01:00
|
|
|
@item -a
|
|
|
|
@itemx --text
|
|
|
|
Treat all files as text.
|
2025-02-24 04:42:45 +01:00
|
|
|
|
2025-02-24 05:01:08 +01:00
|
|
|
@item -b
|
|
|
|
@itemx --ignore-space-change
|
|
|
|
Ignore changes in the amount of white space.
|
2025-02-24 04:42:45 +01:00
|
|
|
|
2025-02-24 05:01:08 +01:00
|
|
|
@item -B
|
|
|
|
@itemx --ignore-blank-lines
|
|
|
|
Ignore changes whose lines are all blank.
|
|
|
|
|
|
|
|
@itemx -c
|
|
|
|
Use the context output format.
|
|
|
|
|
|
|
|
@item -C @var{n}
|
|
|
|
@itemx --context=@var{n}
|
|
|
|
Same as -c but use @var{n} lines of context.
|
|
|
|
|
|
|
|
@item -d
|
|
|
|
@itemx --minimal
|
|
|
|
Try hard to find a smaller set of changes.
|
2025-02-24 04:42:45 +01:00
|
|
|
|
2025-02-24 05:01:08 +01:00
|
|
|
@item -E
|
|
|
|
@itemx --ignore-tab-expansion
|
|
|
|
Ignore changes due to tab expansion.
|
|
|
|
|
|
|
|
@item -i
|
|
|
|
@itemx --ignore-case
|
|
|
|
Ignore case differences in file contents.
|
|
|
|
|
2025-02-24 05:51:09 +01:00
|
|
|
@item -O [@var{format1}][,@var{format2}]
|
|
|
|
@itemx --force-format=[@var{format1}][,@var{format2}]
|
2025-02-24 06:00:49 +01:00
|
|
|
Force the compressed formats given. Any of @var{format1} or @var{format2}
|
|
|
|
may be omitted and the corresponding format will be automatically detected.
|
|
|
|
Valid values for @var{format} are @samp{bz2}, @samp{gz}, @samp{lz},
|
|
|
|
@samp{xz}, and @samp{zst}. If at least one format is specified with this
|
|
|
|
option, the file is passed to the corresponding decompressor 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.
|
2025-02-24 05:51:09 +01:00
|
|
|
|
2025-02-24 05:01:08 +01:00
|
|
|
@item -p
|
|
|
|
@itemx --show-c-function
|
|
|
|
Show which C function each change is in.
|
|
|
|
|
|
|
|
@item -q
|
|
|
|
@itemx --brief
|
|
|
|
Output only whether files differ.
|
|
|
|
|
|
|
|
@item -s
|
|
|
|
@itemx --report-identical-files
|
|
|
|
Report when two files are identical.
|
|
|
|
|
|
|
|
@item -t
|
|
|
|
@itemx --expand-tabs
|
|
|
|
Expand tabs to spaces in output.
|
|
|
|
|
|
|
|
@item -T
|
|
|
|
@itemx --initial-tab
|
|
|
|
Make tabs line up by prepending a tab.
|
|
|
|
|
|
|
|
@item -u
|
|
|
|
Use the unified output format.
|
|
|
|
|
|
|
|
@item -U @var{n}
|
|
|
|
@itemx --unified=@var{n}
|
|
|
|
Same as -u but use @var{n} lines of context.
|
|
|
|
|
2025-02-24 06:00:49 +01:00
|
|
|
@item -v
|
|
|
|
@itemx --verbose
|
|
|
|
When specified before @samp{--version}, print the version of the diff
|
|
|
|
program used.
|
|
|
|
|
2025-02-24 05:01:08 +01:00
|
|
|
@item -w
|
|
|
|
@itemx --ignore-all-space
|
|
|
|
Ignore all white space.
|
|
|
|
|
|
|
|
@end table
|
2025-02-24 04:42:45 +01:00
|
|
|
|
|
|
|
|
|
|
|
@node Zgrep
|
|
|
|
@chapter Zgrep
|
|
|
|
@cindex zgrep
|
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
zgrep is a front end to the program grep that allows transparent search
|
|
|
|
on any combination of compressed and uncompressed files. If any file
|
|
|
|
given is compressed, its decompressed content is used. If a file given
|
2025-02-24 05:01:08 +01:00
|
|
|
does not exist, and its name does not end with one of the known
|
|
|
|
extensions, zgrep tries the compressed file names corresponding to the
|
2025-02-24 05:57:59 +01:00
|
|
|
formats supported. If a file fails to decompress, zgrep continues
|
|
|
|
searching the rest of the files.
|
2025-02-24 05:40:39 +01:00
|
|
|
|
2025-02-24 05:57:59 +01:00
|
|
|
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
|
|
|
|
must be of the same type; all uncompressed or all in the same
|
2025-02-24 05:59:17 +01:00
|
|
|
compressed format.
|
2025-02-24 05:57:59 +01:00
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
If no files are specified, recursive searches examine the current working
|
|
|
|
directory, and nonrecursive searches read standard input.
|
2025-02-24 04:51:33 +01:00
|
|
|
|
2025-02-24 04:42:45 +01:00
|
|
|
The format for running zgrep is:
|
|
|
|
|
|
|
|
@example
|
2025-02-24 05:01:08 +01:00
|
|
|
zgrep [@var{options}] @var{pattern} [@var{files}]
|
2025-02-24 04:42:45 +01:00
|
|
|
@end example
|
|
|
|
|
|
|
|
@noindent
|
2025-02-24 05:01:08 +01:00
|
|
|
An exit status of 0 means at least one match was found, 1 means no
|
|
|
|
matches were found, and 2 means trouble.
|
2025-02-24 04:42:45 +01:00
|
|
|
|
2025-02-24 05:56:02 +01:00
|
|
|
zgrep supports the following options (some options only work if the grep
|
|
|
|
program used supports them):
|
2025-02-24 04:42:45 +01:00
|
|
|
|
2025-02-24 05:52:24 +01:00
|
|
|
@table @code
|
2025-02-24 05:01:08 +01:00
|
|
|
@item -a
|
|
|
|
@itemx --text
|
|
|
|
Treat all files as text.
|
|
|
|
|
|
|
|
@item -A @var{n}
|
|
|
|
@itemx --after-context=@var{n}
|
|
|
|
Print @var{n} lines of trailing context.
|
|
|
|
|
|
|
|
@item -b
|
|
|
|
@itemx --byte-offset
|
|
|
|
Print the byte offset of each line.
|
|
|
|
|
|
|
|
@item -B @var{n}
|
|
|
|
@itemx --before-context=@var{n}
|
|
|
|
Print @var{n} lines of leading context.
|
|
|
|
|
|
|
|
@item -c
|
|
|
|
@itemx --count
|
|
|
|
Only print a count of matching lines per file.
|
|
|
|
|
|
|
|
@item -C @var{n}
|
|
|
|
@itemx --context=@var{n}
|
|
|
|
Print @var{n} lines of output context.
|
|
|
|
|
2025-02-24 05:56:02 +01:00
|
|
|
@item --color[=@var{when}]
|
2025-02-24 05:59:17 +01:00
|
|
|
Show matched strings in color. @var{when} is @samp{never}, @samp{always},
|
2025-02-24 05:56:02 +01:00
|
|
|
or @samp{auto}.
|
|
|
|
|
2025-02-24 05:01:08 +01:00
|
|
|
@item -e @var{pattern}
|
|
|
|
@itemx --regexp=@var{pattern}
|
|
|
|
Use @var{pattern} as the pattern to match.
|
|
|
|
|
|
|
|
@item -E
|
|
|
|
@itemx --extended-regexp
|
|
|
|
Treat @var{pattern} as an extended regular expression.
|
|
|
|
|
|
|
|
@item -f @var{file}
|
|
|
|
@itemx --file=@var{file}
|
2025-02-24 05:53:08 +01:00
|
|
|
Obtain patterns from @var{file}, one per line.@*
|
|
|
|
When searching in several files at once, command substitution can be
|
2025-02-24 05:59:17 +01:00
|
|
|
used with @samp{-e} to read @var{file} only once, for example if
|
2025-02-24 05:53:08 +01:00
|
|
|
@var{file} is not a regular file:
|
2025-02-24 05:59:17 +01:00
|
|
|
@w{@samp{zgrep -e "$(cat @var{file})" file1.lz file2.gz}}
|
2025-02-24 05:01:08 +01:00
|
|
|
|
|
|
|
@item -F
|
|
|
|
@itemx --fixed-strings
|
|
|
|
Treat @var{pattern} as a set of newline-separated strings.
|
|
|
|
|
|
|
|
@item -h
|
|
|
|
@itemx --no-filename
|
2025-02-24 05:51:09 +01:00
|
|
|
Suppress the prefixing of file names on output when multiple files are
|
2025-02-24 05:40:39 +01:00
|
|
|
searched.
|
2025-02-24 05:01:08 +01:00
|
|
|
|
|
|
|
@item -H
|
|
|
|
@itemx --with-filename
|
2025-02-24 05:51:09 +01:00
|
|
|
Print the file name for each match.
|
2025-02-24 05:01:08 +01:00
|
|
|
|
|
|
|
@item -i
|
|
|
|
@itemx --ignore-case
|
|
|
|
Ignore case distinctions.
|
|
|
|
|
|
|
|
@item -I
|
|
|
|
Ignore binary files.
|
|
|
|
|
|
|
|
@item -l
|
|
|
|
@itemx --files-with-matches
|
|
|
|
Only print names of files containing at least one match.
|
|
|
|
|
|
|
|
@item -L
|
|
|
|
@itemx --files-without-match
|
2025-02-24 05:59:59 +01:00
|
|
|
Only print names of files not containing any matches.@*
|
|
|
|
Note: option -L fails (prints wrong results, returns wrong status, and even
|
|
|
|
hangs) when using GNU grep versions 3.2 to 3.4 inclusive because of a wrong
|
|
|
|
change in the exit status of grep, which was reverted in GNU grep 3.5.
|
2025-02-24 05:01:08 +01:00
|
|
|
|
|
|
|
@item -m @var{n}
|
|
|
|
@itemx --max-count=@var{n}
|
|
|
|
Stop after @var{n} matches.
|
|
|
|
|
|
|
|
@item -n
|
|
|
|
@itemx --line-number
|
|
|
|
Prefix each matched line with its line number in the input file.
|
|
|
|
|
|
|
|
@item -o
|
|
|
|
@itemx --only-matching
|
|
|
|
Show only the part of matching lines that actually matches @var{pattern}.
|
|
|
|
|
2025-02-24 05:51:09 +01:00
|
|
|
@item -O @var{format}
|
|
|
|
@itemx --force-format=@var{format}
|
2025-02-24 05:59:17 +01:00
|
|
|
Force the compressed format given. Valid values for @var{format} are
|
2025-02-24 06:00:49 +01:00
|
|
|
@samp{bz2}, @samp{gz}, @samp{lz}, @samp{xz}, and @samp{zst}. If this option
|
|
|
|
is used, the files are passed to the corresponding decompressor without
|
|
|
|
verifying their format, and the exact file name must be given. Other names
|
|
|
|
won't be tried.
|
2025-02-24 05:51:09 +01:00
|
|
|
|
2025-02-24 05:01:08 +01:00
|
|
|
@item -q
|
|
|
|
@itemx --quiet
|
2025-02-24 05:45:53 +01:00
|
|
|
Suppress all messages. Exit immediately with zero status if any match is
|
|
|
|
found, even if an error was detected.
|
2025-02-24 05:01:08 +01:00
|
|
|
|
|
|
|
@item -r
|
|
|
|
@itemx --recursive
|
2025-02-24 05:59:17 +01:00
|
|
|
For each directory operand, read and process all files in that directory,
|
|
|
|
recursively. Follow symbolic links given in the command line, but skip
|
|
|
|
symbolic links that are encountered recursively.
|
2025-02-24 05:57:59 +01:00
|
|
|
|
|
|
|
@item -R
|
|
|
|
@itemx --dereference-recursive
|
2025-02-24 05:59:17 +01:00
|
|
|
For each directory operand, read and process all files in that directory,
|
|
|
|
recursively, following all symbolic links.
|
2025-02-24 05:01:08 +01:00
|
|
|
|
|
|
|
@item -s
|
|
|
|
@itemx --no-messages
|
2025-02-24 05:45:53 +01:00
|
|
|
Suppress error messages about nonexistent or unreadable files.
|
2025-02-24 05:01:08 +01:00
|
|
|
|
|
|
|
@item -v
|
|
|
|
@itemx --invert-match
|
|
|
|
Select non-matching lines.
|
|
|
|
|
|
|
|
@item --verbose
|
2025-02-24 06:00:49 +01:00
|
|
|
Verbose mode. Show error messages. When specified before @samp{--version},
|
|
|
|
print the version of the grep program used.
|
2025-02-24 05:01:08 +01:00
|
|
|
|
|
|
|
@item -w
|
|
|
|
@itemx --word-regexp
|
|
|
|
Match only whole words.
|
|
|
|
|
|
|
|
@item -x
|
|
|
|
@itemx --line-regexp
|
|
|
|
Match only whole lines.
|
|
|
|
|
2025-02-24 04:42:45 +01:00
|
|
|
@end table
|
|
|
|
|
|
|
|
|
2025-02-24 04:58:36 +01:00
|
|
|
@node Ztest
|
|
|
|
@chapter Ztest
|
|
|
|
@cindex ztest
|
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
ztest verifies the integrity of the compressed files specified.
|
2025-02-24 05:57:59 +01:00
|
|
|
Uncompressed files are ignored. If a file is specified as @samp{-}, the
|
|
|
|
integrity of compressed data read from standard input is verified. Data
|
2025-02-24 05:59:17 +01:00
|
|
|
read from standard input must be all in the same compressed format. If
|
|
|
|
a file fails to decompress, does not exist, can't be opened, or is a
|
|
|
|
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.
|
2025-02-24 05:57:59 +01:00
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
If no files are specified, recursive searches examine the current working
|
|
|
|
directory, and nonrecursive searches read standard input.
|
2025-02-24 05:40:39 +01:00
|
|
|
|
2025-02-24 06:00:49 +01:00
|
|
|
Bzip2, gzip, and lzip are the primary formats. Xz and zstd are optional. If
|
|
|
|
the decompressor for the xz or zstd formats is not found, the corresponding
|
|
|
|
files are ignored.
|
|
|
|
|
2025-02-24 05:54:33 +01:00
|
|
|
Note that error detection in the xz format is broken. First, some xz
|
|
|
|
files lack integrity information. Second, not all xz decompressors can
|
|
|
|
@uref{http://www.nongnu.org/lzip/xz_inadequate.html#fragmented,,verify the integrity}
|
|
|
|
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}
|
|
|
|
allows xz decompressors to produce garbage output without issuing any
|
|
|
|
warning. Therefore, xz files can't always be verified as reliably as
|
|
|
|
files in the other formats can.
|
|
|
|
@c We can only hope that xz is soon abandoned.
|
2025-02-24 04:58:36 +01:00
|
|
|
|
|
|
|
The format for running ztest is:
|
|
|
|
|
|
|
|
@example
|
|
|
|
ztest [@var{options}] [@var{files}]
|
|
|
|
@end example
|
|
|
|
|
|
|
|
@noindent
|
2025-02-24 05:40:39 +01:00
|
|
|
The exit status is 0 if all compressed files verify OK, 1 if
|
|
|
|
environmental problems (file not found, invalid flags, I/O errors, etc),
|
|
|
|
2 if any compressed file is corrupt or invalid.
|
2025-02-24 04:58:36 +01:00
|
|
|
|
2025-02-24 05:52:24 +01:00
|
|
|
ztest supports the following options:
|
2025-02-24 04:58:36 +01:00
|
|
|
|
2025-02-24 05:52:24 +01:00
|
|
|
@table @code
|
2025-02-24 05:51:09 +01:00
|
|
|
@item -O @var{format}
|
|
|
|
@itemx --force-format=@var{format}
|
2025-02-24 05:59:17 +01:00
|
|
|
Force the compressed format given. Valid values for @var{format} are
|
2025-02-24 06:00:49 +01:00
|
|
|
@samp{bz2}, @samp{gz}, @samp{lz}, @samp{xz}, and @samp{zst}. If this option
|
|
|
|
is used, the files are passed to the corresponding decompressor without
|
|
|
|
verifying their format, and any files in a format that the decompressor
|
|
|
|
can't understand will fail. For example, @samp{--force-format=gz} can test
|
|
|
|
gzipped (.gz) and compress'd (.Z) files if the compressor used is GNU gzip.
|
2025-02-24 05:40:39 +01:00
|
|
|
|
2025-02-24 05:01:08 +01:00
|
|
|
@item -q
|
|
|
|
@itemx --quiet
|
2025-02-24 04:58:36 +01:00
|
|
|
Quiet operation. Suppress all messages.
|
|
|
|
|
2025-02-24 05:01:08 +01:00
|
|
|
@item -r
|
|
|
|
@itemx --recursive
|
2025-02-24 05:59:17 +01:00
|
|
|
For each directory operand, read and process all files in that directory,
|
|
|
|
recursively. Follow symbolic links given in the command line, but skip
|
|
|
|
symbolic links that are encountered recursively.
|
2025-02-24 05:57:59 +01:00
|
|
|
|
|
|
|
@item -R
|
|
|
|
@itemx --dereference-recursive
|
2025-02-24 05:59:17 +01:00
|
|
|
For each directory operand, read and process all files in that directory,
|
|
|
|
recursively, following all symbolic links.
|
2025-02-24 04:58:36 +01:00
|
|
|
|
2025-02-24 05:01:08 +01:00
|
|
|
@item -v
|
|
|
|
@itemx --verbose
|
2025-02-24 05:45:13 +01:00
|
|
|
Verbose mode. Show the verify status for each file processed.@*
|
2025-02-24 04:58:36 +01:00
|
|
|
Further -v's increase the verbosity level.
|
|
|
|
|
|
|
|
@end table
|
|
|
|
|
|
|
|
|
2025-02-24 05:45:13 +01:00
|
|
|
@node Zupdate
|
|
|
|
@chapter Zupdate
|
|
|
|
@cindex zupdate
|
|
|
|
|
2025-02-24 06:00:49 +01:00
|
|
|
zupdate recompresses files from bzip2, gzip, xz, and zstd formats to lzip
|
|
|
|
format. Each original is compared with the new file and then deleted. Only
|
|
|
|
regular files with standard file name extensions are recompressed, other
|
|
|
|
files are ignored. Compressed files are decompressed and then recompressed
|
|
|
|
on the fly; no temporary files are created. If an error happens while
|
|
|
|
recompressing a file, zupdate exits immediately without recompressing the
|
|
|
|
rest of the files. The lzip format is chosen as destination because it is
|
|
|
|
the most appropriate for long-term data archiving.
|
2025-02-24 05:57:59 +01:00
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
If no files are specified, recursive searches examine the current working
|
|
|
|
directory, and nonrecursive searches do nothing.
|
2025-02-24 05:45:13 +01:00
|
|
|
|
|
|
|
If the lzip compressed version of a file already exists, the file is
|
2025-02-24 05:59:17 +01:00
|
|
|
skipped unless the option @samp{--force} is given. In this case, if the
|
2025-02-24 05:46:38 +01:00
|
|
|
comparison with the existing lzip version fails, an error is returned
|
|
|
|
and the original file is not deleted. The operation of zupdate is meant
|
2025-02-24 05:59:17 +01:00
|
|
|
to be safe and not cause any data loss. Therefore, existing lzip
|
2025-02-24 05:46:38 +01:00
|
|
|
compressed files are never overwritten nor deleted.
|
2025-02-24 05:45:13 +01:00
|
|
|
|
2025-02-24 06:00:49 +01:00
|
|
|
Recompressing files from a read-only file system to another place can be
|
|
|
|
done by first linking the files from the destination directory and then
|
|
|
|
compressing the links: @w{@samp{ln -s /src/foo.gz . && zupdate foo.gz}}
|
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
Combining the options @samp{--force} and @samp{--keep}, as in
|
|
|
|
@w{@samp{zupdate -f -k *.gz}}, verifies that there are no differences
|
2025-02-24 05:51:09 +01:00
|
|
|
between each pair of files in a multiformat set of files.
|
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
The names of the original files must have one of the following extensions:@*
|
2025-02-24 06:00:49 +01:00
|
|
|
@samp{.bz2}, @samp{.gz}, @samp{.xz}, or @samp{.zst}, which are recompressed
|
|
|
|
to @samp{.lz};@*
|
|
|
|
@samp{.tbz}, @samp{.tbz2}, @samp{.tgz}, @samp{.txz}, or @samp{.tzst}, which
|
|
|
|
are recompressed to @samp{.tlz}.@*
|
2025-02-24 05:59:17 +01:00
|
|
|
Keeping the combined extensions (@samp{.tgz} --> @samp{.tlz}) may be useful
|
|
|
|
when recompressing Slackware packages, for example.
|
2025-02-24 05:45:13 +01:00
|
|
|
|
2025-02-24 06:00:49 +01:00
|
|
|
Bzip2, gzip, and lzip are the primary formats. Xz and zstd are optional. If
|
|
|
|
the decompressor for the xz or zstd formats is not found, the corresponding
|
|
|
|
files are ignored.
|
|
|
|
|
2025-02-24 05:59:17 +01:00
|
|
|
Recompressing a file is much like copying or moving it; therefore zupdate
|
|
|
|
preserves the access and modification dates, permissions, and, when
|
2025-02-24 06:00:49 +01:00
|
|
|
possible, ownership of the file just as @w{@samp{cp -p}} does. (If the user ID or
|
2025-02-24 05:59:17 +01:00
|
|
|
the group ID can't be duplicated, the file permission bits S_ISUID and
|
|
|
|
S_ISGID are cleared).
|
2025-02-24 05:51:09 +01:00
|
|
|
|
2025-02-24 05:45:13 +01:00
|
|
|
The format for running zupdate is:
|
|
|
|
|
|
|
|
@example
|
|
|
|
zupdate [@var{options}] [@var{files}]
|
|
|
|
@end example
|
|
|
|
|
|
|
|
@noindent
|
2025-02-24 05:59:17 +01:00
|
|
|
Exit status is 0 if all the compressed files were successfully recompressed
|
|
|
|
(if needed), compared, and deleted (if requested). Non-zero otherwise.
|
2025-02-24 05:45:13 +01:00
|
|
|
|
2025-02-24 05:52:24 +01:00
|
|
|
zupdate supports the following options:
|
2025-02-24 05:45:13 +01:00
|
|
|
|
2025-02-24 05:52:24 +01:00
|
|
|
@table @code
|
2025-02-24 05:45:13 +01:00
|
|
|
@item -f
|
|
|
|
@itemx --force
|
2025-02-24 05:53:08 +01:00
|
|
|
Don't skip a file for which a lzip compressed version already exists.
|
2025-02-24 05:45:13 +01:00
|
|
|
@samp{--force} compares the content of the input file with the content
|
2025-02-24 05:46:38 +01:00
|
|
|
of the existing lzip file and deletes the input file if both contents
|
|
|
|
are identical.
|
2025-02-24 05:45:13 +01:00
|
|
|
|
2025-02-24 05:45:53 +01:00
|
|
|
@item -k
|
|
|
|
@itemx --keep
|
|
|
|
Keep (don't delete) the input file after comparing it with the lzip file.
|
|
|
|
|
2025-02-24 05:45:13 +01:00
|
|
|
@item -l
|
|
|
|
@itemx --lzip-verbose
|
2025-02-24 05:59:17 +01:00
|
|
|
Pass one option @samp{-v} to the lzip compressor so that it shows the
|
|
|
|
compression ratio for each file processed. Using lzip 1.15 or newer, a
|
2025-02-24 05:45:13 +01:00
|
|
|
second @samp{-l} shows the progress of compression. Use it together with
|
|
|
|
@samp{-v} to see the name of the file.
|
|
|
|
|
|
|
|
@item -q
|
|
|
|
@itemx --quiet
|
|
|
|
Quiet operation. Suppress all messages.
|
|
|
|
|
|
|
|
@item -r
|
|
|
|
@itemx --recursive
|
2025-02-24 05:59:17 +01:00
|
|
|
For each directory operand, read and process all files in that directory,
|
|
|
|
recursively. Follow symbolic links given in the command line, but skip
|
|
|
|
symbolic links that are encountered recursively.
|
2025-02-24 05:57:59 +01:00
|
|
|
|
|
|
|
@item -R
|
|
|
|
@itemx --dereference-recursive
|
2025-02-24 05:59:17 +01:00
|
|
|
For each directory operand, read and process all files in that directory,
|
|
|
|
recursively, following all symbolic links.
|
2025-02-24 05:45:13 +01:00
|
|
|
|
|
|
|
@item -v
|
|
|
|
@itemx --verbose
|
|
|
|
Verbose mode. Show the files being processed. A second @samp{-v} also
|
|
|
|
shows the files being ignored.
|
|
|
|
|
|
|
|
@item -0 .. -9
|
2025-02-24 05:59:17 +01:00
|
|
|
Set the compression level of lzip. By default zupdate passes @samp{-9} to
|
|
|
|
lzip. Custom compression options can be passed to lzip with the option
|
|
|
|
@samp{--lz}. For example @w{@samp{--lz='lzip -9 -s64MiB'}}.
|
2025-02-24 05:45:13 +01:00
|
|
|
|
|
|
|
@end table
|
|
|
|
|
|
|
|
|
2025-02-24 04:42:45 +01:00
|
|
|
@node Problems
|
2025-02-24 05:45:13 +01:00
|
|
|
@chapter Reporting bugs
|
2025-02-24 04:42:45 +01:00
|
|
|
@cindex bugs
|
|
|
|
@cindex getting help
|
|
|
|
|
|
|
|
There are probably bugs in zutils. There are certainly errors and
|
|
|
|
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
|
|
|
|
for all eternity, if not longer.
|
|
|
|
|
|
|
|
If you find a bug in zutils, please send electronic mail to
|
2025-02-24 04:44:01 +01:00
|
|
|
@email{zutils-bug@@nongnu.org}. Include the version number, which you can
|
2025-02-24 05:59:17 +01:00
|
|
|
find by running @w{@samp{zupdate --version}}.
|
2025-02-24 04:42:45 +01:00
|
|
|
|
|
|
|
|
2025-02-24 05:43:00 +01:00
|
|
|
@node Concept index
|
|
|
|
@unnumbered Concept index
|
2025-02-24 04:42:45 +01:00
|
|
|
|
|
|
|
@printindex cp
|
|
|
|
|
|
|
|
@bye
|