56 lines
2.0 KiB
Markdown
56 lines
2.0 KiB
Markdown
|
lz.sh (lz and uz)
|
||
|
=================
|
||
|
|
||
|
The `lz.sh` script emulates and extends commands `lz` and `uz` from the mtools.
|
||
|
|
||
|
**Note**: although `lz.sh` is more powerful than mtools' `lz` and `uz`, you
|
||
|
should probably use `als` and `aunpack` from the atool package instead; they
|
||
|
are much better and atool provides several other useful commands as well. This
|
||
|
script is still useful when you can't install Perl (atool is written in Perl).
|
||
|
|
||
|
This script handles the following archive formats through the standards options
|
||
|
of GNU Tar:
|
||
|
|
||
|
- tar
|
||
|
- tar.gz (tgz)
|
||
|
- tar.bz2 (tbz, tb2)
|
||
|
- tar.xz (txz)
|
||
|
- tar.lzma (tlz)
|
||
|
- tar.Z (taz)
|
||
|
|
||
|
Note that you need GNU Tar, at least version 1.20 to support LZMA compressed
|
||
|
archives, and version 1.22 for XZ compressed ones.
|
||
|
|
||
|
If the script is called as `lz`, the archive content is displayed. When called
|
||
|
as `uz`, it is extracted.
|
||
|
|
||
|
To install `lz` and `uz`, move the script as `lz` in a directory in your `PATH`
|
||
|
(for instance `/usr/local/bin` or `$HOME/bin`) and hard link it to `uz`:
|
||
|
|
||
|
cp lz.sh /usr/local/bin/lz
|
||
|
ln /usr/local/bin/{lz,uz}
|
||
|
|
||
|
Alternatively, you can use the symbolic links provided along with the
|
||
|
repository by adding the `bin` directory to your `PATH`, as explained in the
|
||
|
main `README.md` file.
|
||
|
|
||
|
|
||
|
xzize.sh
|
||
|
========
|
||
|
|
||
|
The `xzize.sh` script compresses an uncompressed file, or recompresses a
|
||
|
compressed file to XZ (with default compression level).
|
||
|
|
||
|
Known compression formats are GZip (.gz), BZip2 (.bz2), LZMA (.lzma), and
|
||
|
Lempel-Ziv (.Z). Short tar compressed suffixes are also allowed: .tgz, .tbz,
|
||
|
.tb2, .tlz, .taz.
|
||
|
|
||
|
In case of recompression, the original compressed file is kept. In case of
|
||
|
compression (i.e. when the suffix of the file does not correspond to a known
|
||
|
compression format), the original uncompressed file is removed.
|
||
|
|
||
|
**Note**: the atool package provides the `arepack` command, which can
|
||
|
recompress to several formats and not only to XZ. `xzize` has the advantage to
|
||
|
recompress on the fly rather than unpacking the archive entirely on the file
|
||
|
system and repacking it afterwards.
|