• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

.gitignoreD11-Mar-2024178 2219

COPYINGD11-Mar-202417.7 KiB340281

MakefileD11-Mar-20246.2 KiB192123

README.mdD11-Mar-20243.5 KiB8567

bench.cD11-Mar-202428 KiB747564

bench.hD11-Mar-20241.5 KiB4012

datagen.cD11-Mar-20245.8 KiB190117

datagen.hD11-Mar-20241.6 KiB413

lz4-exe.rc.inD11-Mar-2024850 2726

lz4.1D11-Mar-20248.9 KiB242240

lz4.1.mdD11-Mar-20248.1 KiB251184

lz4cli.cD11-Mar-202434.2 KiB789598

lz4io.cD11-Mar-202462.9 KiB1,6781,243

lz4io.hD11-Mar-20245 KiB13536

platform.hD11-Mar-20246.7 KiB15696

util.hD11-Mar-202421.1 KiB653500

README.md

1Command Line Interface for LZ4 library
2============================================
3
4### Build
5The Command Line Interface (CLI) can be generated
6using the `make` command without any additional parameters.
7
8The `Makefile` script supports all [standard conventions](https://www.gnu.org/prep/standards/html_node/Makefile-Conventions.html),
9including standard targets (`all`, `install`, `clean`, etc.)
10and standard variables (`CC`, `CFLAGS`, `CPPFLAGS`, etc.).
11
12For advanced use cases, there are targets to different variations of the CLI:
13- `lz4` : default CLI, with a command line syntax close to gzip
14- `lz4c` : Same as `lz4` with additional support legacy lz4 commands (incompatible with gzip)
15- `lz4c32` : Same as `lz4c`, but forced to compile in 32-bits mode
16
17The CLI generates and decodes [LZ4-compressed frames](../doc/lz4_Frame_format.md).
18
19
20#### Aggregation of parameters
21CLI supports aggregation of parameters i.e. `-b1`, `-e18`, and `-i1` can be joined into `-b1e18i1`.
22
23
24#### Benchmark in Command Line Interface
25CLI includes in-memory compression benchmark module for lz4.
26The benchmark is conducted using a given filename.
27The file is read into memory.
28It makes benchmark more precise as it eliminates I/O overhead.
29
30The benchmark measures ratio, compressed size, compression and decompression speed.
31One can select compression levels starting from `-b` and ending with `-e`.
32The `-i` parameter selects a number of seconds used for each of tested levels.
33
34
35
36#### Usage of Command Line Interface
37The full list of commands can be obtained with `-h` or `-H` parameter:
38```
39Usage :
40      lz4 [arg] [input] [output]
41
42input   : a filename
43          with no FILE, or when FILE is - or stdin, read standard input
44Arguments :
45 -1     : Fast compression (default)
46 -9     : High compression
47 -d     : decompression (default for .lz4 extension)
48 -z     : force compression
49 -D FILE: use FILE as dictionary
50 -f     : overwrite output without prompting
51 -k     : preserve source files(s)  (default)
52--rm    : remove source file(s) after successful de/compression
53 -h/-H  : display help/long help and exit
54
55Advanced arguments :
56 -V     : display Version number and exit
57 -v     : verbose mode
58 -q     : suppress warnings; specify twice to suppress errors too
59 -c     : force write to standard output, even if it is the console
60 -t     : test compressed file integrity
61 -m     : multiple input files (implies automatic output filenames)
62 -r     : operate recursively on directories (sets also -m)
63 -l     : compress using Legacy format (Linux kernel compression)
64 -B#    : cut file into blocks of size # bytes [32+]
65                     or predefined block size [4-7] (default: 7)
66 -BD    : Block dependency (improve compression ratio)
67 -BX    : enable block checksum (default:disabled)
68--no-frame-crc : disable stream checksum (default:enabled)
69--content-size : compressed frame includes original size (default:not present)
70--[no-]sparse  : sparse mode (default:enabled on file, disabled on stdout)
71--favor-decSpeed: compressed files decompress faster, but are less compressed
72--fast[=#]: switch to ultra fast compression level (default: 1)
73
74Benchmark arguments :
75 -b#    : benchmark file(s), using # compression level (default : 1)
76 -e#    : test all compression levels from -bX to # (default : 1)
77 -i#    : minimum evaluation time in seconds (default : 3s)```
78```
79
80#### License
81
82All files in this directory are licensed under GPL-v2.
83See [COPYING](COPYING) for details.
84The text of the license is also included at the top of each source file.
85