% LaTeX document produced by pod2latex from "lzop.pod".
% The followings need be defined in the preamble of this document:
%\def\C++{{\rm C\kern-.05em\raise.3ex\hbox{\footnotesize ++}}}
%\def\underscore{\leavevmode\kern.04em\vbox{\hrule width 0.4em height 0.3pt}}
%\setlength{\parindent}{0pt}

\section{LZOP}%
\index{LZOP}

\subsection*{NAME}
lzop --- compress or expand files

\subsection*{ABSTRACT}%
\index{ABSTRACT}

{\bf lzop} is a file compressor very similar to {\bf gzip}.
{\bf lzop} favors speed over compression ratio.

\subsection*{SYNOPSIS}
{\bf lzop} S$<${\tt [} {\em command\/} {\tt ]}$>$ S$<${\tt [} {\em options\/} {\tt ]}$>$ S$<${\tt [} {\em filename\/} ...  {\tt ]}$>$

{\bf lzop} S$<${\tt [}{\bf -dxlthIVL19}{\tt ]}$>$ S$<${\tt [}{\bf -qvcfFnNkU}{\tt ]}$>$
S$<${\tt [}{\bf -o} {\em file\/}{\tt ]}$>$ S$<${\tt [}{\bf -p}{\tt [}{\em path\/}{\tt ]}{\tt ]}$>$ S$<${\tt [}{\bf -S} {\em suffix\/}{\tt ]}$>$
S$<${\tt [}{\em filename\/} ...{\tt ]}$>$

\subsection*{DESCRIPTION}
{\bf lzop} reduces the size of the named files. Whenever possible,
each file is compressed into one with the extension
{\bf .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. In particular, it will ignore
directories and symbolic links.

If the compressed file name is too long for its file system,
{\bf lzop} truncates it.

Compressed files can be restored to their original form
using S$<${\bf lzop -d}$>$.
S$<${\bf lzop -d}$>$ takes a list of files on its command line and
decompresses each file whose name ends with {\bf .lzo} and which
begins with the correct magic number to an uncompressed
file without the original extension. S$<${\bf lzop -d}$>$ also recognizes
the special extension {\bf .tzo} as shorthand for {\bf .tar.lzo}.
When compressing, lzop uses the {\bf .tzo} extension if necessary
instead of truncating a file with a {\bf .tar} extension.

{\bf lzop} stores the original file name, mode and time stamp
in the compressed file. These can be used when
decompressing the file with the {\bf -d} option. This is useful when
the compressed file name was truncated or when the time
stamp was not preserved after a file transfer.

{\bf 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 {\bf -n}, {\bf -N}, {\bf {\tt --}no-mode} and {\bf {\tt --}no-time}
for more information.

{\bf lzop} always keeps original files unchanged unless
you use the option {\bf -U}.

{\bf lzop} uses the {\em 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 {\bf gzip}, but
compression ratio is worse.

\subsubsection*{COMPRESSION LEVELS}%
\index{COMPRESSION LEVELS}

lzop offers the following compression levels of the
LZO1X algorithm:

\begin{description}

\item[$-$3]\hfil\\
the default level offers pretty fast compression.
Note that $-$2, $-$3, $-$4, $-$5 and $-$6 are currently all equivalent --- this
may change in a future release.

\item[$-$1, --fast]%
\index{-1, --fast@$-$1, --fast}%
\hfil\\
can be even a little bit faster in some cases --- but
most times you won't notice the difference

\item[$-$7, $-$8, $-$9, --best]%
\index{-7, -8, -9, --best@$-$7, $-$8, $-$9, --best}%
\hfil\\
these compression levels are mainly intended for generating
pre-compressed data --- especially {\bf -9} can be somewhat slow

\end{description}

Decompression is {\em very\/} fast for all compression levels.

\subsection*{MAIN COMMAND}%
\index{MAIN COMMAND}

If no other command is given then lzop defaults to compression.

\begin{description}

\item[-\#, --fast, --best]%
\index{-#, --fast, --best@-\#, --fast, --best}%
\hfil\\
Regulate the speed of compression using the specified
digit {\bf \#}, where $-$1 or --fast indicates the
fastest compression method (less compression) and
$-$9 or --best indicates the slowest compression
method (best compression). The default compression
level is $-$3.

\item[-d, --decompress, --uncompress]%
\index{-d, --decompress, --uncompress@-d, --decompress, --uncompress}%
\hfil\\
Decompress. Each file will be placed into
same the directory as the compressed file.

\item[-x, --extract]%
\index{-x, --extract@-x, --extract}%
\hfil\\
Extract compressed files to the current working
directory. This is the same as `-dNp'.

\item[-t, --test]%
\index{-t, --test@-t, --test}%
\hfil\\
Test. Check the compressed file integrity.

\item[-l, --list]%
\index{-l, --list@-l, --list}%
\hfil\\
For each compressed file, list the following
fields:
\begin{verbatim}
  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
\end{verbatim}

In combination with the --verbose option, the following
fields are also displayed:
\begin{verbatim}
  date & time: time stamp for the uncompressed file
\end{verbatim}

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\underscore{}size / uncompressed\underscore{}size.

\item[--ls, --ls={\em FLAGS\/}]%
\index{--ls, --ls=FLAGS@--ls, --ls={\em FLAGS\/}}%
\hfil\\
List each compressed file in a format similar to S$<${\bf ls -ln}$>$.

The following flags are currently honoured:
  F  Append a `$\ast$' for executable files.
  G  Inhibit display of group information.
  Q  Enclose file names in double quotes.

\item[--info]%
\index{--info@--info}%
\hfil\\
For each compressed file, list the internal header fields.

\item[-I, --sysinfo]%
\index{-I, --sysinfo@-I, --sysinfo}%
\hfil\\
Display information about the system and quit.

\item[-L, --license]%
\index{-L, --license@-L, --license}%
\hfil\\
Display the lzop license and quit.

\item[-h, -H, --help]%
\index{-h, -H, --help@-h, -H, --help}%
\hfil\\
Display a help screen and quit.

\item[-V]%
\index{-V@-V}%

Version. Display the version number and compilation
options then quit.

\item[--version]%
\index{--version@--version}%
\hfil\\
Version. Display the version number then quit.

\end{description}

Note that {\bf -t} has priority over {\bf -d}, {\bf -l} over {\bf -t}, and so on.

\subsection*{OPTIONS}%
\index{OPTIONS}

\begin{description}

\item[-c, --stdout, --to-stdout]%
\index{-c, --stdout, --to-stdout@-c, --stdout, --to-stdout}%
\hfil\\
Write output on standard output. If there are several
input files, the output consists of a sequence
of independently (de)compressed members. To obtain
better compression, concatenate all input files
before compressing them.

\item[-o {\em FILE\/}, --output={\em FILE\/}]%
\index{-o FILE, --output=FILE@-o {\em FILE\/}, --output={\em FILE\/}}%
\hfil\\
Write output to the file {\em FILE\/}. If there are several
input files, the output consists of a sequence
of independently (de)compressed members.

\item[-p, -p{\em DIR\/}, --path={\em DIR\/}]%
\index{-p, -pDIR, --path=DIR@-p, -p{\em DIR\/}, --path={\em DIR\/}}%
\hfil\\
Write output files into the directory {\em DIR\/} instead
of the directory determined by the input file. If
{\em DIR\/} is omitted, then write to the current working
directory.

\item[-f, --force]%
\index{-f, --force@-f, --force}%
\hfil\\
Force lzop to
\begin{verbatim}
 - overwrite existing files
 - compress from stdin even if it seems a terminal
 - compress to stdout even if it seems a terminal
 - allow option -c in combination with -U
\end{verbatim}

Using {\bf -f} two or more times forces things like
\begin{verbatim}
 - compress files that already have a .lzo suffix
 - decompress files that do not have a valid suffix
 - try to handle compressed files with unknown header flags
\end{verbatim}

Use with care.

\item[-F, --no-checksum]%
\index{-F, --no-checksum@-F, --no-checksum}%
\hfil\\
Do not store or verify a checksum of the uncompressed
file when compressing or decompressing.
This speeds up the operation of lzop a little bit (especially
when decompressing), but as unnoticed data corruption can happen
in case of damaged compressed files the usage of this option
is not generally recommended.
Also, a checksum is always stored when compressing with one of
the slow compression levels ($-$7, $-$8 or $-$9).

\item[-n, --no-name]%
\index{-n, --no-name@-n, --no-name}%
\hfil\\
When decompressing, do not restore the original
file name if present (remove only the lzop suffix
from the compressed file name). This option is the
default under UNIX.

\item[-N, --name]%
\index{-N, --name@-N, --name}%
\hfil\\
When decompressing, restore the original file name
if present. This option is useful on systems which
have a limit on file name length. If the original name saved in
the compressed file is not suitable for its file system, a
new name is constructed from the original one to make it
legal.
This option is the default under DOS, Windows and OS/2.

\item[--no-mode]%
\index{--no-mode@--no-mode}%
\hfil\\
When decompressing, do not restore the original
mode (permissions) saved in the compressed file.

\item[--no-time]%
\index{--no-time@--no-time}%
\hfil\\
When decompressing, do not restore the original
time stamp saved in the compressed file.

\item[-S {\em .suf\/}, --suffix={\em .suf\/}]%
\index{-S .suf, --suffix=.suf@-S {\em .suf\/}, --suffix={\em .suf\/}}%
\hfil\\
Use suffix {\em .suf\/} instead of {\em .lzo\/}. The suffix must
not contain multiple dots and special characters like '+' or '$\ast$',
and suffixes other than {\em .lzo\/} should be avoided to avoid confusion
when files are transferred to other systems.

\item[-k, --keep]%
\index{-k, --keep@-k, --keep}%
\hfil\\
Do not delete input files. This is the default.

\item[-U, --unlink, --delete]%
\index{-U, --unlink, --delete@-U, --unlink, --delete}%
\hfil\\
Delete input files after succesfull compression or
decompression. Beware. Use this option to make lzop behave
like {\bf gzip}. Note that {\bf -k} overrides {\bf -U}.

\item[--no-stdin]%
\index{--no-stdin@--no-stdin}%
\hfil\\
Do not try to read standard input. This option is necessary in cron jobs
(which do not have a controlling terminal).
A file name "$-$" will still override this option.

\item[--no-warn]%
\index{--no-warn@--no-warn}%
\hfil\\
Suppress all warnings.

\item[--ignore-warn]%
\index{--ignore-warn@--ignore-warn}%
\hfil\\
Suppress all warnings, and never exit with exit status 2.

\item[-q, --quiet, --silent]%
\index{-q, --quiet, --silent@-q, --quiet, --silent}%
\hfil\\
Suppress all warnings and decrease the verbosity of some
commands like {\bf {\tt --}list} or {\bf {\tt --}test}.

\item[-v, --verbose]%
\index{-v, --verbose@-v, --verbose}%
\hfil\\
Verbose. Display the name for each file compressed
or decompressed. Multiple {\bf -v} can be used to increase
the verbosity of some commands like {\bf {\tt --}list} or {\bf {\tt --}test}.

\item[--]
Specifies that this is the end of the options. Any file name
after {\bf {\tt --}} will not be interpreted as an option even if
it starts with a hyphen.

\end{description}

\subsection*{OTHER OPTIONS}%
\index{OTHER OPTIONS}

\begin{description}

\item[--no-color]%
\index{--no-color@--no-color}%
\hfil\\
Do not use any color escape sequences.

\item[--mono]%
\index{--mono@--mono}%
\hfil\\
Assume a mono ANSI terminal. This is the default under UNIX.

\item[--color]%
\index{--color@--color}%
\hfil\\
Assume a color ANSI terminal or try full-screen access. This
is the default under DOS and in a Linux virtual console.

\item[--intro]%
\index{--intro@--intro}%
\hfil\\
Try to display that nice intro sequence then quit. Needs full-screen access.

\item[--filter={\em NUMBER\/}]%
\index{--filter=NUMBER@--filter={\em NUMBER\/}}%
\hfil\\
Rarely useful.
Preprocess data with a special "multimedia" filter
before compressing in order to improve compression ratio.
{\em NUMBER\/} must be a decimal number from 1 to 16, inclusive.
Using a filter slows down both compression and decompression
quite a bit, and the compression ratio usually doesn't improve
much either...
More effective filters may be added in the future, though.

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.

\item[-C, --checksum]%
\index{-C, --checksum@-C, --checksum}%
\hfil\\
Deprecated. Only for compatibility with old versions
as lzop now uses a checksum by default. This option may
get removed in a future release.

\end{description}

\subsection*{ADVANCED USAGE}%
\index{ADVANCED USAGE}

lzop allows you to deal with your files in many flexible
ways. Here are some usage examples:

\begin{description}

\item[{\bf single file mode:} individually (de)compress each file]%
\index{single file mode: individually (de)compress each file@{\bf single file mode:} individually (de)compress each file}%
\begin{verbatim}
 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
\end{verbatim}
\begin{verbatim}
 extract
   lzop -d a.c.lzo      -> restore a.c
   lzop -df a.c.lzo     -> restore a.c, overwrite if already exists
   lzop -d *.lzo
\end{verbatim}
\begin{verbatim}
 list
   lzop -l a.c.lzo
   lzop -l *.lzo
   lzop -lv *.lzo       -> be verbose
\end{verbatim}
\begin{verbatim}
 test
   lzop -t a.c.lzo
   lzop -tq *.lzo       -> be quiet
\end{verbatim}

\item[{\bf pipe mode:} (de)compress from stdin to stdout]%
\index{pipe mode: (de)compress from stdin to stdout@{\bf pipe mode:} (de)compress from stdin to stdout}%
\begin{verbatim}
 create
   lzop < a.c > y.lzo
   cat a.c | lzop > y.lzo
   tar -cf - *.c | lzop > y.tar.lzo     -> create a compressed tar file
\end{verbatim}
\begin{verbatim}
 extract
   lzop -d < y.lzo > a.c
   lzop -d < y.tar.lzo | tar -xvf -     -> extract a tar file
   lzop -d < y.tar.lzo | tar -tvf -     -> list a tar file
\end{verbatim}
\begin{verbatim}
 list
   lzop -l < y.lzo
   cat y.lzo | lzop -l
\end{verbatim}
\begin{verbatim}
 test
   lzop -t < y.lzo
   cat y.lzo | lzop -t
\end{verbatim}

\item[{\bf stdout mode:} (de)compress to stdout]%
\index{stdout mode: (de)compress to stdout@{\bf stdout mode:} (de)compress to stdout}%
\begin{verbatim}
 create
   lzop -c a.c > y.lzo
\end{verbatim}
\begin{verbatim}
 extract
   lzop -dc y.lzo > a.c
   lzop -dc y.tar.lzo | tar -tvf -      -> list a tar file
\end{verbatim}

\item[{\bf archive mode:} compress/extract multiple files into a single archive file]%
\index{archive mode: compress/extract multiple files into a single archive file@{\bf archive mode:} compress/extract multiple files into a single archive file}%
\begin{verbatim}
 create
   lzop a.c b.c -o sources.lzo          -> create an archive
   lzop -c *.c > sources.lzo            -> another way to create an archive
   lzop -c *.h >> sources.lzo           -> add files to archive
\end{verbatim}
\begin{verbatim}
 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
\end{verbatim}
\begin{verbatim}
 list
   lzop -lNv sources.lzo
\end{verbatim}
\begin{verbatim}
 test
   lzop -t sources.lzo
   lzop -tvv sources.lzo                -> be very verbose
\end{verbatim}

\end{description}

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 or zip. The latest version of GNU tar supports the
{\bf~{\tt~--}use-compress-program=lzop} option to invoke lzop transparently.
lzop is designed as a complement to tar, not as
a replacement.

\subsection*{ENVIRONMENT}
The environment variable {\bf 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:
\begin{verbatim}
    for sh/ksh/zsh:    LZOP="-1v --name"; export LZOP
    for csh/tcsh:      setenv LZOP "-1v --name"
    for DOS:           set LZOP=-1v --name
\end{verbatim}

On Vax/VMS, the name of the environment variable is
LZOP\underscore{}OPT, to avoid a conflict with the symbol set for
invocation of the program.

Note that not all options are valid in the environment variable --- lzop will tell you.

\subsection*{SEE ALSO}
{\bf gzip}(1), {\bf tar}(1), {\bf bzip2}(1)

Precompiled binaries for some platforms should be available
from the lzop home page soon.
\begin{verbatim}
    see http://wildsau.idv.uni-linz.ac.at/mfx/lzop.html
\end{verbatim}

lzop uses the LZO data compression library for compression
services.
\begin{verbatim}
    see http://wildsau.idv.uni-linz.ac.at/mfx/lzo.html
\end{verbatim}

\subsection*{DIAGNOSTICS}
Exit status is normally 0; if an error occurs, exit status
is 1. If a warning occurs, exit status is 2.

{\bf lzop's} diagnostics are intended to be self-explanatory.

\subsection*{BUGS}
Please report all bugs immediately to the author.

\subsection*{AUTHOR}
markus.oberhumer@jk.uni-linz.ac.at

\subsection*{COPYRIGHT}%
\index{COPYRIGHT}

lzop and the LZO library are Copyright (C) 1996, 1997, 1998
by Markus Franz Xaver Johannes Oberhumer.

lzop and the LZO library are distributed under the terms
of the GNU General Public License (GPL).

