LZOP(1) | LZOP(1) |
lzop - compress or expand files
lzop is a file compressor very similar to gzip. lzop favors speed over compression ratio.
lzop [ command ] [ options ] [ filename ... ]
lzop [-dxlthIVL19] [-qvcfFnNPkU] [-o file] [-p[path]] [-S suffix] [filename ...]
lzop reduces the size of the named files. Whenever possible, each file is compressed into one with the extension .lzo, while keeping the same ownership modes, access and modification times. If no files are specified, or if a file name is "-", lzop tries to compress the standard input to the standard output. lzop will only attempt to compress regular files or symbolic links to regular files. In particular, it will ignore directories.
If the compressed file name is too long for its file system, lzop truncates it.
Compressed files can be restored to their original form using lzop -d. lzop -d takes a list of files on its command line and decompresses each file whose name ends with .lzo and which begins with the correct magic number to an uncompressed file without the original extension. lzop -d also recognizes the special extension .tzo as shorthand for .tar.lzo. When compressing, lzop uses the .tzo extension if necessary instead of truncating a file with a .tar extension.
lzop stores the original file name, mode and time stamp in the compressed file. These can be used when decompressing the file with the -d option. This is useful when the compressed file name was truncated or when the time stamp was not preserved after a file transfer.
lzop preserves the ownership, mode and time stamp of files when compressing. When decompressing lzop restores the mode and time stamp if present in the compressed files. See the options -n, -N, --no-mode and --no-time for more information.
lzop always keeps original files unchanged unless you use the option -U.
lzop uses the LZO data compression library for compression services. The amount of compression obtained depends on the size of the input and the distribution of common substrings. Typically, text such as source code or English is compressed into 40-50% of the original size, and large files usually compress much better than small ones. Compression and decompression speed is generally much faster than that achieved by gzip, but compression ratio is worse.
lzop offers the following compression levels of the LZO1X algorithm:
Decompression is very fast for all compression levels, and decompression speed is not affected by the compression level.
If no other command is given then lzop defaults to compression (using compression level -3).
method: compression method compressed: size of the compressed file uncompr.: size of the uncompressed file ratio: compression ratio uncompressed_name: name of the uncompressed file
In combination with the --verbose option, the following fields are also displayed:
date & time: time stamp for the uncompressed file
With --name, the uncompressed name, date and time are those stored within the compress file if present.
With --verbose, the size totals and compression ratio for all files is also displayed. With --quiet, the title and totals lines are not displayed.
Note that lzop defines compression ratio as compressed_size / uncompressed_size.
The following flags are currently honoured:
F Append a '*' for executable files.
G Inhibit display of group information.
Q Enclose file names in double quotes.
- overwrite existing files - (de-)compress from stdin even if it seems a terminal - (de-)compress to stdout even if it seems a terminal - allow option -c in combination with -U
Using -f two or more times forces things like
- compress files that already have a .lzo suffix - try to decompress files that do not have a valid suffix - try to handle compressed files with unknown header flags
Use with care.
You can try --filter=1 with data like 8-bit sound samples, --filter=2 with 16-bit samples or depth-16 images, etc.
Un-filtering during decompression is handled automatically.
lzop allows you to deal with your files in many flexible ways. Here are some usage examples:
tar --use-compress-program=lzop -cf archive.tar.lzo files.. This is the recommended mode for creating backups. Requires GNU tar or a compatible version which accepts the '--use-compress-program=XXX' option.
create lzop a.c -> create a.c.lzo lzop a.c b.c -> create a.c.lzo & b.c.lzo lzop -U a.c b.c -> create a.c.lzo & b.c.lzo and delete a.c & b.c lzop *.c extract lzop -d a.c.lzo -> restore a.c lzop -df a.c.lzo -> restore a.c, overwrite if already exists lzop -d *.lzo list lzop -l a.c.lzo lzop -l *.lzo lzop -lv *.lzo -> be verbose test lzop -t a.c.lzo lzop -tq *.lzo -> be quiet
create lzop < a.c > y.lzo cat a.c | lzop > y.lzo tar -cf - *.c | lzop > y.tar.lzo -> create a compressed tar file extract lzop -d < y.lzo > a.c lzop -d < y.tar.lzo | tar -xvf - -> extract a tar file list lzop -l < y.lzo cat y.lzo | lzop -l lzop -d < y.tar.lzo | tar -tvf - -> list a tar file test lzop -t < y.lzo cat y.lzo | lzop -t
create lzop -c a.c > y.lzo extract lzop -dc y.lzo > a.c lzop -dc y.tar.lzo | tar -xvf - -> extract a tar file list lzop -dc y.tar.lzo | tar -tvf - -> list a tar file
create lzop a.c b.c -o sources.lzo -> create an archive lzop -P src/*.c -o sources.lzo -> create an archive, store path name lzop -c *.c > sources.lzo -> another way to create an archive lzop -c *.h >> sources.lzo -> add files to archive extract lzop -dN sources.lzo lzop -x ../src/sources.lzo -> extract to current directory lzop -x -p/tmp < ../src/sources.lzo -> extract to /tmp directory list lzop -lNv sources.lzo test lzop -t sources.lzo lzop -tvv sources.lzo -> be very verbose
If you wish to create a single archive file with multiple members so that members can later be extracted independently, you should prefer a full-featured archiver such as tar. The latest version of GNU tar supports the --use-compress-program=lzop option to invoke lzop transparently. lzop is designed as a complement to tar, not as a replacement.
The environment variable LZOP can hold a set of default options for lzop. These options are interpreted first and can be overwritten by explicit command line parameters. For example:
for sh/ksh/zsh: LZOP="-1v --name"; export LZOP for csh/tcsh: setenv LZOP "-1v --name" for DOS/Windows: set LZOP=-1v --name
On Vax/VMS, the name of the environment variable is LZOP_OPT, to avoid a conflict with the symbol set for invocation of the program.
Not all of the options are valid in the environment variable - lzop will tell you.
bzip2(1), gzip(1), tar(1), xz(1)
Precompiled binaries for some platforms are available from the lzop home page.
see http://www.oberhumer.com/opensource/lzop/
lzop uses the LZO data compression library for compression services.
see http://www.oberhumer.com/opensource/lzo/
Exit status is normally 0; if an error occurs, exit status is 1. If a warning occurs, exit status is 2 (unless option --ignore-warn is in effect).
lzop's diagnostics are intended to be self-explanatory.
No bugs are known. Please report all problems immediately to the author.
Markus Franz Xaver Johannes Oberhumer <markus@oberhumer.com> http://www.oberhumer.com/opensource/lzop/
lzop and the LZO library are Copyright (C) 1996-2017 Markus Franz Xaver Oberhumer <markus@oberhumer.com>. All Rights Reserved.
lzop and the LZO library are distributed under the terms of the GNU General Public License (GPL).
Legal info: If want to integrate lzop into your commercial (backup-)system please carefully read the GNU GPL FAQ at http://www.gnu.org/licenses/gpl-faq.html about possible implications.
2017-08-10 | lzop 1.04 |