lzo
Compress or decompress LZO files
SYNOPSIS
lzop [options] [files...]
PARAMETERS
-1 ... -9
Sets the compression level. -1 provides the fastest compression (lowest ratio), while -9 offers the best compression (highest ratio, but still very fast). The default is usually -3.
-d, --decompress
Decompress the specified files. This is the inverse operation of compression.
-x, --extract
An alias for --decompress, used to extract compressed files.
-c, --stdout
Write output to standard output instead of a file. The original input files remain unchanged. Useful for piping output to other commands.
-f, --force
Force overwriting of existing output files without prompting for confirmation.
-o
Specify the name of the output file. This option can only be used when compressing or decompressing a single input file.
-n, --no-name
Do not store or restore the original file name, modification time, or file mode/permissions during compression or decompression.
-N, --name
Store the original file name, modification time, and file mode/permissions (this is the default behavior for compression).
-l, --list
List the contents of a compressed LZO file, including details like compressed size, uncompressed size, and original file name.
-t, --test
Test the integrity of a compressed LZO file to check for corruption without decompressing it.
-v, --verbose
Enable verbose output, displaying progress information and detailed messages during operations.
-h, --help
Display a help message with command usage and options, then exit.
-V, --version
Display the version information of the lzop utility and exit.
DESCRIPTION
The lzo command, commonly implemented as lzop on Linux systems, is a utility for compressing and decompressing files using the LZO (Lempel-Ziv-Oberhumer) algorithm. Unlike compression tools like gzip or bzip2 that prioritize maximum compression ratio, LZO's primary design goal is extremely fast compression and decompression speeds, often at the expense of a higher compression ratio. This characteristic makes it particularly well-suited for applications where speed is critical, such as real-time data processing, embedded systems, network communications, and kernel-level compression (e.g., for initramfs or SquashFS filesystems). The lzo command operates on single files, typically appending a .lzo or .lzop suffix to compressed files. It can also decompress files with these suffixes back to their original form.
CAVEATS
Compression Ratio: While exceptionally fast, LZO typically achieves lower compression ratios compared to other algorithms like gzip, bzip2, or xz.
Single File Operation: lzop primarily operates on single files. It does not natively support recursive directory compression; for archiving entire directories, it's typically used in conjunction with archiving tools like tar.
Ubiquity: Although widely used in specific domains, lzop might not be as universally installed or recognized on all Linux systems as gzip or bzip2.
ALGORITHM FOCUS
The LZO algorithm is specifically optimized for extreme speed, making it suitable for scenarios where CPU cycles are at a premium and latency needs to be minimized, even if it means larger compressed file sizes. This makes it a popular choice for fast data streaming and temporary storage.
FILE EXTENSION
Files compressed with lzo (or lzop) typically carry the .lzo or .lzop file extension. When decompressing, this suffix is usually removed to restore the original file name, unless otherwise specified by the user.
HISTORY
The LZO (Lempel-Ziv-Oberhumer) algorithm and its associated tools, including lzop, were developed by Markus F.X.J. Oberhumer, with the initial version released in 1998. The project's primary goal was to create a compression library that excelled in speed and had low memory requirements, making it ideal for resource-constrained environments and high-performance applications. Over the years, LZO has found widespread adoption in various critical systems, including the Linux kernel (e.g., for initramfs, squashfs, zram), embedded devices, and applications where real-time compression/decompression is paramount.