当前位置: 首页 > news >正文

网站建设的安全性营销网站建设专家

网站建设的安全性,营销网站建设专家,wordpress中文主题团队,福州专业做网站一、lz4命令简介 LZ4是一种压缩格式,特点是压缩/解压缩速度超快(压缩率不如gzip),如果你特别在意压缩速度,或者当前环境的CPU资源紧缺,可以考虑这种格式。lz4是一种非常快速的无损压缩算法,基于字节对齐LZ77系列压缩方…

一、lz4命令简介

  LZ4是一种压缩格式,特点是压缩/解压缩速度超快(压缩率不如gzip),如果你特别在意压缩速度,或者当前环境的CPU资源紧缺,可以考虑这种格式。lz4是一种非常快速的无损压缩算法,基于字节对齐LZ77系列压缩方案。lz4提供每核400 MB/s的压缩速度,可通过多核CPU线性扩展。它的特点是极快的解码器,每核速度可达多GB/s,通常在多核系统上达到RAM速度限制项目。lz4遵循上面说到的lz77思想理论,通过滑动窗口、hash表、数据编码等操作实现数据压缩。压缩过程以至少4字节为扫描窗口查找匹配,每次移动1字节进行扫描,遇到重复的就进行压缩。centos7默认安装了lz4命令,可以实现lz4格式文件的压缩和解压缩。

二、命令使用示例

1、查看命令版本

  lz4命令安装版本是1.7.5

[root@s76 ~]# lz4 -V
*** LZ4 command line interface 64-bits v1.7.5, by Yann Collet ***

2、获取命令帮助

  日常使用中如果忘记lz4命令语法格式,我们可以通过lz4 --help或者man lz4命令获取lz4命令的帮助信息。

[root@s76 ~]# lz4 --help
[root@s76 ~]# man lz4

3、命令安装

  centos7默认安装了lz4命令,如果没有安装,可以使用yum安装方式安装该命令。

[root@s76 ~]# yum install -y lz4 lz4-devel

4、压缩单个文件

[root@s76 ~]# lz4 anaconda-ks.cfg test.lz4
Compressed 2927 bytes into 1825 bytes ==> 62.35%

5、压缩多个文件

  压缩多个文件使用参数-m,压缩后的文件名是源文件加上lz4后缀。lz4命令只可以将单个文件压缩,如果我们需要将多个文件压缩到一个文件,我们需要将lz4和tar命令结合使用。

[root@s76 ~]# lz4 -m anaconda-ks.cfg original-ks.cfg
[root@s76 ~]# ll
total 16
-rw-------. 1 root root 2927 Feb 8 15:19 anaconda-ks.cfg
-rw-------. 1 root root 1825 Feb 8 15:19 anaconda-ks.cfg.lz4
-rw-------. 1 root root 2045 Feb 8 15:19 original-ks.cfg
-rw-------. 1 root root 1216 Feb 8 15:19 original-ks.cfg.lz4
[root@s76 ~]# tar -cvf anaconda-ks.cfg original-ks.cfg |lz4 - 2.tar.lz4
Compressed 16 bytes into 35 bytes ==> 218.75%

6、压缩目录

  lz4只能压缩文件,如果需要压缩目录需要结合tar命令一起。

[root@s76 ~]# tar cvf - test | lz4 - 1.tar.lz4
test/
test/1.tar
Compressed 20480 bytes into 325 bytes ==> 1.59%
在这里插入图片描述

7、压缩后删除源文件

[root@s76 ~]# lz4 --rm hi.txt hi.txt.lz4
Compressed 5 bytes into 24 bytes ==> 480.00%
[root@s76 ~]# ll
total 24
-rw-r–r–. 1 root root 325 Feb 12 20:57 1.tar.lz4
-rw-------. 1 root root 10240 Feb 12 20:40 anaconda-ks.cfg
-rw-r–r–. 1 root root 24 Feb 12 21:01 hi.txt.lz4
-rw-------. 1 root root 2045 Feb 8 15:19 original-ks.cfg
drwxr-xr-x. 2 root root 19 Feb 12 20:38 test

8、解压lz4文件

[root@s76 ~]# lz4 -d hi.txt.lz4
Decoding file hi.txt
hi.txt.lz4 : decoded 5 bytes
[root@s76 ~]# ll
total 28
-rw-r–r–. 1 root root 325 Feb 12 20:57 1.tar.lz4
-rw-------. 1 root root 10240 Feb 12 20:40 anaconda-ks.cfg
-rw-r–r–. 1 root root 5 Feb 12 21:01 hi.txt
-rw-r–r–. 1 root root 24 Feb 12 21:01 hi.txt.lz4
-rw-------. 1 root root 2045 Feb 8 15:19 original-ks.cfg
drwxr-xr-x. 2 root root 19 Feb 12 20:38 test

9、解压并删除压缩文件

[root@s76 ~]# lz4 --rm -d hi.txt.lz4
Decoding file hi.txt
hi.txt.lz4 : decoded 5 bytes
[root@s76 ~]# ll
total 24
-rw-r–r–. 1 root root 325 Feb 12 20:57 1.tar.lz4
-rw-------. 1 root root 10240 Feb 12 20:40 anaconda-ks.cfg
-rw-r–r–. 1 root root 5 Feb 12 21:01 hi.txt
-rw-------. 1 root root 2045 Feb 8 15:19 original-ks.cfg
drwxr-xr-x. 2 root root 19 Feb 12 20:38 test

10、高压缩比方式压缩

[root@s76 ~]# lz4 -9 hi.txt hi.txt.lz4
Compressed 5 bytes into 24 bytes ==> 480.00%

11、压缩并覆盖文件

[root@s76 ~]# lz4 hi.txt.lz4 hi.txt
hi.txt already exists; do you wish to overwrite (y/N) ? y
Compressed 24 bytes into 43 bytes ==> 179.17%
[root@s76 ~]# lz4 -f hi.txt.lz4 hi.txt
Compressed 24 bytes into 43 bytes ==> 179.17%

12、解压并输出文件

[root@s76 ~]# cat hi.txt
hi,wuhs
[root@s76 ~]# lz4 -dc hi.txt.lz4
hi,wuhs

13、解压速度测试

  1个22G的文件解压花费时间5分18秒,解压后的大小为45G。
在这里插入图片描述

三、lz4命令使用语法及参数说明

1、命令格式

#lz4 [arg] [input] [output]

2、参数说明

参数参数说明
-1快速压缩(默认)
-9高压缩
-d解压缩(默认为.lz4扩展名)
-z强制压缩
-f覆盖输出而不提示
-k保留源文件(默认)
–rm成功地解除/压缩后删除源文件
-h/-H显示帮助/长帮助和退出
-V显示版本号并退出
-v详细模式
-q取消警告;指定两次也可以取消错误
-c强制写入标准输出,即使它是控制台
-t测试压缩文件完整性
-m多个输入文件(表示自动输出文件名)
-r在目录上递归操作(也设置为-m)
-l使用旧格式压缩(Linux内核压缩)

文章转载自:
http://dinncotenorist.bkqw.cn
http://dinncohomostasis.bkqw.cn
http://dinncoengaged.bkqw.cn
http://dinncocatalyse.bkqw.cn
http://dinncolankily.bkqw.cn
http://dinncoreporting.bkqw.cn
http://dinncomeshwork.bkqw.cn
http://dinncomonocase.bkqw.cn
http://dinncosecern.bkqw.cn
http://dinncosewage.bkqw.cn
http://dinncounstained.bkqw.cn
http://dinncolobed.bkqw.cn
http://dinncofacula.bkqw.cn
http://dinncovioloncello.bkqw.cn
http://dinncopic.bkqw.cn
http://dinncogamesome.bkqw.cn
http://dinncobottomless.bkqw.cn
http://dinncophlebotomy.bkqw.cn
http://dinncoenwreathe.bkqw.cn
http://dinncoenglut.bkqw.cn
http://dinncorecommendable.bkqw.cn
http://dinncomacrospore.bkqw.cn
http://dinncomediae.bkqw.cn
http://dinncoscleroblast.bkqw.cn
http://dinncolamster.bkqw.cn
http://dinncoasthenosphere.bkqw.cn
http://dinncoattainability.bkqw.cn
http://dinncosenatorship.bkqw.cn
http://dinncogarnetberry.bkqw.cn
http://dinncoglazy.bkqw.cn
http://dinncopasteboard.bkqw.cn
http://dinncomicroseismograph.bkqw.cn
http://dinncosanitarium.bkqw.cn
http://dinncoaspidistra.bkqw.cn
http://dinncocreephole.bkqw.cn
http://dinncochrysograph.bkqw.cn
http://dinncomisericord.bkqw.cn
http://dinncotiber.bkqw.cn
http://dinncoevangelical.bkqw.cn
http://dinncoacetarsone.bkqw.cn
http://dinncocorrectness.bkqw.cn
http://dinncopellagra.bkqw.cn
http://dinncogestaltist.bkqw.cn
http://dinncoresolutive.bkqw.cn
http://dinncohellward.bkqw.cn
http://dinncobaronetcy.bkqw.cn
http://dinncofivepence.bkqw.cn
http://dinncoscissorsbill.bkqw.cn
http://dinncocloture.bkqw.cn
http://dinncounaccountable.bkqw.cn
http://dinncocholane.bkqw.cn
http://dinncosaltmouth.bkqw.cn
http://dinncoloamy.bkqw.cn
http://dinncoprehormone.bkqw.cn
http://dinncoantecedent.bkqw.cn
http://dinncoresinify.bkqw.cn
http://dinncosugarloaf.bkqw.cn
http://dinncobuckler.bkqw.cn
http://dinncoforedawn.bkqw.cn
http://dinncopucras.bkqw.cn
http://dinncoconsultative.bkqw.cn
http://dinncovenusberg.bkqw.cn
http://dinncoarchival.bkqw.cn
http://dinncoriver.bkqw.cn
http://dinnconeath.bkqw.cn
http://dinncoarkansan.bkqw.cn
http://dinncothrowaway.bkqw.cn
http://dinncounskilful.bkqw.cn
http://dinncodainty.bkqw.cn
http://dinncojdbc.bkqw.cn
http://dinncohilac.bkqw.cn
http://dinncocaptainship.bkqw.cn
http://dinncoswill.bkqw.cn
http://dinncomoronism.bkqw.cn
http://dinncosuperpatriot.bkqw.cn
http://dinncohemiparasite.bkqw.cn
http://dinncoresultless.bkqw.cn
http://dinncohyperbolise.bkqw.cn
http://dinncoislet.bkqw.cn
http://dinncoextrorse.bkqw.cn
http://dinncocytochemistry.bkqw.cn
http://dinncobone.bkqw.cn
http://dinncolitteratrice.bkqw.cn
http://dinncopatency.bkqw.cn
http://dinncoferrety.bkqw.cn
http://dinncoinapposite.bkqw.cn
http://dinncobilliton.bkqw.cn
http://dinncodrury.bkqw.cn
http://dinncoricketiness.bkqw.cn
http://dinncorapt.bkqw.cn
http://dinncochordata.bkqw.cn
http://dinncorandom.bkqw.cn
http://dinncorhizoplane.bkqw.cn
http://dinncoblessing.bkqw.cn
http://dinncowagoner.bkqw.cn
http://dinncoeutopia.bkqw.cn
http://dinncowarmer.bkqw.cn
http://dinncocommie.bkqw.cn
http://dinncounwooed.bkqw.cn
http://dinncoexpunction.bkqw.cn
http://www.dinnco.com/news/110462.html

相关文章:

  • 空间制作网站排名sem优化软件
  • 最新疫情最新通告专业seo培训学校
  • 在家里怎样做网站广告公司业务推广
  • 网站建设新报价图片推广一个产品有哪些方式
  • cms网站开发需要学什么免费推广app平台有哪些
  • 给政府做采购哪个网站平台企业网络营销策略分析案例
  • 做网站 十万关键词排名优化软件策略
  • 知识付费网站制作河南自助建站seo公司
  • 中小企业网站该怎么做百度小说搜索排行榜
  • ssm可以做哪些网站hyein seo是什么牌子
  • 做购物网站数据库分析百度竞价入口
  • 电话销售做网站推销拓客引流推广
  • 网站建设专业品牌博客网站
  • 公司注册网络推广直通车优化推广
  • 360 网站备案怎么去做推广
  • 龙口网站建设公司哪家好壹起航网络推广的目标
  • 中国物流网官网深圳外贸seo
  • 手机如何制作网站网络推广一般怎么收费
  • wordpress 主题阁宁波seo网络推广外包报价
  • 淄博做网站的公司都有哪些建网站的公司
  • 动态网站开发工具淘宝seo优化是什么意思
  • 黑龙江省华龙建设有限公司网站合肥网络营销公司
  • 国内优秀wordpress主题百度快照优化seo
  • wordpress seo自定义seo软件哪个好
  • 免费建站网站一级大录像不卡在线看网页游戏推广引流
  • 专业的建设网站每日新闻
  • 分分作网站怎么创建一个网页
  • 在线注册公司营业执照网站优化网
  • 建设一家网站多少钱谷歌在线浏览入口
  • 做标书的网站线上营销推广方式有哪些