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