lz
Compress files using Lempel-Ziv algorithm
TLDR
List all files inside a compressed archive
SYNOPSIS
lz [options] [file(s)]
PARAMETERS
-c
Write to standard output, keeping original files unchanged.
-d
Decompress.
-f
Force overwriting existing files.
-k
Keep (don't delete) input files during compression or decompression.
-q
Quiet mode; suppress all messages.
-t
Test compressed file integrity.
-v
Verbose mode; display compression statistics.
-h
Display help message.
-V
Display version information.
DESCRIPTION
The `lz` command in Linux is primarily a wrapper around other compression utilities, offering a consistent interface for compressing and decompressing files using the Lempel-Ziv family of algorithms.
It simplifies the compression process by automatically selecting the appropriate compression program (like `gzip`, `bzip2`, or `xz`) based on the file extension. The utility manages the specifics of calling the underlying utilities to compress or decompress a file, making the action transparent to the user.
It's particularly useful when you want to compress multiple files with different extensions without needing to remember the specific commands and options for each compression type. `lz` can also work with piped input and output. However, `lz` is not a standard Linux command available on all distributions by default.
CAVEATS
The `lz` command may not be pre-installed on all Linux distributions. You might need to install it separately, possibly from distribution-specific repositories. Availability and behavior can also vary across different versions and implementations.
FILE EXTENSION HANDLING
The `lz` utility typically determines the compression method based on the file extension. For instance, '.gz' implies gzip, '.bz2' implies bzip2, and '.xz' implies xz. If no recognized extension is present, it might default to a particular compression algorithm or require explicit instructions.
INSTALLATION
If `lz` is not found, you can install it using your distribution's package manager. Common methods include using `apt` (Debian/Ubuntu), `yum` or `dnf` (Red Hat/CentOS/Fedora), or `pacman` (Arch Linux).