Ubuntu压缩/解压lz4文件

0x00前言

  lz4压缩算法致力于提高压缩和解压的速度,项目中接触到lz4压缩的文件,这里介绍如何在Ubuntu下进行lz4文件的压缩与解压

0x01安装

安装命令如下:

1
apt-get install liblz4-tool

0x02使用

1.快速压缩文件:lz4 test.txt
2.解压lz4文件:lz4 -d test.lz4
3.更多用法,执行lz4 -h如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Usage :
lz4 [arg] [input] [output]
input : a filename
with no FILE, or when FILE is - or stdin, read standard input
Arguments :
-1 : Fast compression (default)
-9 : High compression
-d : decompression (default for .lz4 extension)
-z : force compression
-f : overwrite output without prompting
-h/-H : display help/long help and exit
Advanced arguments :
-V : display Version number and exit
-v : verbose mode
-q : suppress warnings; specify twice to suppress errors too
-c : force write to standard output, even if it is the console
-t : test compressed file integrity
-l : compress using Legacy format (Linux kernel compression)
-B# : Block size [4-7](default : 7)
-BD : Block dependency (improve compression ratio)
-BX : enable block checksum (default:disabled)
-Sx : disable stream checksum (default:enabled)
Benchmark arguments :
-b : benchmark file(s)
-i# : iteration loops [1-9](default : 3), benchmark mode only