Manual browser: lzf(1)

LZF(1) General Commands Manual LZF(1)


lzfcompress and uncompress files using LZF algorithm


lzf [-bcdfhv] file [file [...]]

unlzf file [file [...]]

lzfcat file [file [...]]


lzf is a simple program to compress or uncompress files using LZF (sometimes known as "Lempel-Ziv Fast") coding. LZF is extremely fast, about 75% of the performance of memcpy(3) for many inputs, while offering a moderate compression ratio, usually between 1.5:1 and 2:1.

When compressing, it removes each input file and replaces it with an output file with the suffix “.lzf” appended. When uncompressing, it removes each input file and replaces it with an output file with the suffix “.lzf” removed. If no files are specified as arguments, standard input and standard output are used as input and output respectively.

If invoked as lzf, the default mode of operation is to compress. If invoked as unlzf, the default mode of operation is to uncompress. If invoked as lzfcat, the default mode of operation is to uncompress to standard output.


The following options are available:
This option selects a compression blocksize. Small compression block sizes give poor compression and slow operation; the default of 64KiB is strongly recommended. Block sizes larger than 64KiB are silently reduced to 64KiB in order to not produce output incompatible with other versions of lzf.
This option selects compression.
This option selects decompression.
This option forces overwrite of preexisting output files, if any.
This option prints command usage.
This option prints compression statistics for each file processed.


The lzf program was first included with version 0.1 of Marc Lehmann's LZF library. It was rewritten for version 2.0 of the library to offer the current syntax, which is mostly compatible with other compression utilities such as gzip(1). The lzf program first appeared in NetBSD 7.0.


The lzf program was written by Stefan Traby <>.


Some versions of lzf install a program named “lzcat” instead of lzfcat. Because the (lzcat) name is also used by xz(1), in NetBSD the name lzfcat is used instead.
September 16, 2012 NetBSD 7.0