首页 > 其他分享 >压缩解压

压缩解压

时间:2024-04-02 15:13:46浏览次数:13  
标签:解压 QQ 压缩 best password root id localhost

gzip bzip2
gzip bzip2
压缩 gzip [-9] 文件名… bzip2 [-9] 文件名...
解压 gzip -d .gz格式的压缩文件 bzip2 -d .bz2格式的压缩文件
提高压缩比例,但是文件较大时效率会低

9代表压缩比率,9最大1最小,默认为9

使用以上两种压缩不保留源文件

gzip的压缩率要高于bzip2

因为只能对文件操作所以基本不使用

[root@localhost best]# ls
head  id  passwd  password  QQ  tail  vimtutor
[root@localhost best]# gzip passwd
[root@localhost best]# ls
head  id  passwd.gz  password  QQ  tail  vimtutor
[root@localhost best]# gzip -d .gz
[root@localhost best]# ls
head  id  passwd  password  QQ  tail  vimtutor

[root@localhost best]# ls
head  id  passwd  password  QQ  tail  vimtutor
[root@localhost best]# bzip2 passwd
[root@localhost best]# ls
head  id  passwd.bz2  password  QQ  tail  vimtutor
[root@localhost best]# bzip2 -d passwd.bz2 
[root@localhost best]# ls
head  id  passwd  password  QQ  tail  vimtutor
tar

格式:

压缩:tar [选项] ... 归档文件名 源文件或目录
解压:tar [选项] ... 归档文件名 [-C 目标目录]

  • -c:创建(Create).tar 格式的包文件
  • -x:解开.tar 格式的包文件
  • -C:解压时指定释放的目标文件夹
  • -f:表示使用归档文件(一般都要带上表示使用tar)
  • -p:打包时保留文件及目录的权限
  • -P:打包时保留文件及目录的绝对径
  • -t:列表查看包内的文件(要和f一起使用)
  • -v:输出详细信息(Verbose)
  • -j:调用 bzip2 程序进行压缩或解压
  • -z:调用 gzip 程序进行压缩或解压

压缩文件(-j与-z用法相同)

[root@localhost best]# ls
head  id  list  passwd  password  QQ  tail  vimtutor
[root@localhost best]# rm -rf list 
[root@localhost best]# ls
head  id  passwd  password  QQ  tail  vimtutor
[root@localhost best]# tar -zcvf list.tar.gz id password QQ 
id
password
QQ
[root@localhost best]# ls
head  id  list.tar.gz  passwd  password  QQ  tail  vimtutor

解压(-j与-z可加可不加)

[root@localhost best]# ls
head  id  list.tar.gz  passwd  password  QQ  tail  vimtutor
[root@localhost best]# tar xvf list.tar.gz -C /opt
id
password
QQ
[root@localhost best]# ls /opt
id  nginx-1.18.0  nginx-1.18.0.tar.gz  password  QQ  rh

标签:解压,QQ,压缩,best,password,root,id,localhost
From: https://www.cnblogs.com/GrandOB/p/18110604

相关文章

  • BetterZip2024功能强大、操作便捷且用户体验优秀的Mac端解压缩软件
    作为一名软件专家,对于市面上各类软件都有较为深入的了解,下面介绍的是一款适用于Mac系统的解压缩软件——BetterZip,将从其功能特点、使用方法、用户体验及适用人群等方面进行详细介绍。BetterZip5-安装包绿色版下载如下:https://wm.makeding.com/iclk/?zoneid=60187首先是功......
  • BetterZip2024Mac上一款功能强大的Mac平台解压压缩软件
    一、软件概述BetterZip是一款Mac平台上的压缩解压缩工具,它为用户提供了一个方便的方式来处理各种压缩文件,包括但不限于ZIP、TAR、GZIP等格式。除了基本的压缩解压缩功能外,BetterZip还具备文件预览、文件加密、分卷压缩等高级功能,使得用户能够更加灵活高效地管理自己的压缩文件......
  • 【雷达】基于Matlab模拟固定雷达LFM信号的仿真与压缩,建立了对移动目标的回波模型
     ✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,代码获取、论文复现及科研仿真合作可私信。......
  • ie中可以进行图片压缩的库
    onBeforeRead(file){returnnewPromise((resolve,reject)=>{newCompressorjs(file,{//压缩质量,0-1//quality:0.6,////转换的类型,默认为image/png////convertTypes:['image/jpeg','image/png&......
  • 压缩图片的递归方法
    authJob(n){if(n<=0){return}else{this.rpc.load.authJob(this.fileList[n-1].raw).then((res)=>{this.outerFileList.push(res)if(n-1==0){......
  • Nginx静态压缩和代码压缩,提高访问速度!
    https://mp.weixin.qq.com/s/0yfUWWfM2RcQBgCiAKcZLAnginx静态资源动态压缩nginx静态资源静态压缩基于目前大部分的应用,都使用了前后端分离的框架,vue的前端应用,也是十分的流行。不知道大家有无遇到这样的问题:随着前端框架的页面,功能开发不断的迭代;安装的依赖,不断的增多;这......
  • Linux基础命令篇之——压缩与解压(tar、gzip、bzip2、zip和unzip)
    linux基础命令——解压与压缩以下是关于Linux命令tar、gzip、bzip2、zip和unzip的详细介绍:1.tar这个是Linux用的最多的解压缩命令tar是Linux系统中用于创建和处理归档文件的命令。归档文件是一个包含多个文件和/或目录的单一文件。常与压缩命令gzip或bzip2结合使用,以减......
  • 微信小程序 图片压缩
    主要是通过canvas进行压缩兼容wx.compressImageAPIwx.compressImage还没测试,canvas缩放宽高比才能达到压缩utils/compressImage.js//compressImage.js/***@param{object}img包含path:图片的path,size:图片的大小*@param{object}canvascanvas对象*@param{n......
  • MogDB 安装解压错误:cannot run bzip2: No such file or directory
    MogDB安装解压错误:cannotrunbzip2:Nosuchfileordirectory本文出处:https://www.modb.pro/db/403662问题症状MogDB安装时,涉及两个步骤解压,第一步解压缩tar包:[root@enmotech~]#tar-xvfMogDB-2.1.1-CentOS-x86_64.tarupgrade_sql.tar.gzMogDB-2.1.1-CentOS-64bit......
  • 状态压缩的三种模型
    第一种类型(摆放方块): 代码如下:#include<iostream>#include<climits>#include<algorithm>#include<cstring>#include<cstdio>#include<cmath>#include<queue>#include<string>#include<vector>usingnamespacestd;......