当前位置:网站首页>压缩解压
压缩解压
2022-06-28 10:19:00 【0&1 * 1】
zip/unzip
zip命令可以用来解压缩文件,或者对文件进行打包操作
unzip命令用于解压缩由zip命令压缩的“.zip”压缩包
这两个不是Linux自带的,需要安装
sudo apt-get install zip
sudo apt-get install unzip
zip:
-q:不显示指令执行过程
-r:递归处理,将指定目录下的所有文件和子目录一并处理
unzip:
-o 解压时不再询问,直接覆盖
-d 将文件解压到指定的文件夹下
zip -q -r ~/test.zip test # 指定路径压缩
unzip test.zip -d ~/tmp/a # 指定路径解压
gzip/gunzip
gzip命令用来压缩文件。gzip是个使用广泛的压缩程序,文件经它压缩过后,其名称后面会多处.gz扩展名。
gunzip命令用来解压缩文件。gunzip是个使用广泛的解压缩程序,它用于解开被gzip压缩过的文件,这些压缩文件预设最后的扩展名为.gz。事实上gunzip就是gzip的硬连接,因此不论是压缩或解压缩,都可通过gzip指令单独完成
gzip:
-d 对压缩的文件进行解压
-r 递归式压缩指定目录以及子目录下的所有文件
-l 显示压缩文件的压缩信息
-c 保留源文件
gunzip:
-c 把解压后的文件输出到标准输出设备
-f 强行解开压缩文件
-q 不显示警告信息
-r 递归处理
-v 显示命令执行过程
gzip a.py
gzip -c b.py > b.py.gz # 保留源文件
gzip -d a.py.gz # 解压
bzip2/bunzip2
bzip2命令用于创建和管理(包括解压缩).bz2格式的压缩包,它是Linux下的一款压缩软件,比传统的gzip或zip的压缩效率更高,但是它的压缩速度较慢。
bunzip2命令解压缩由bzip2指令创建的.bz2压缩包
-c 将压缩与解压缩结果送到标准输出
-d 执行解压缩
-f 文件同名时,预设不会覆盖现有文件,使用这个会覆盖
-k bizp2 在压缩或解压缩后,会删除原始文件,使用这个不会删除
-s 降低程序执行时内存的使用量
-v 压缩或解压缩文件时,显示详细的信息
bzip2 a.py
bzip2 -c b.py > b.py.bz2 # 保留源文件
bzip2 -d a.py.bz2 # 解压
文件打包
tar命令用于将文件打包或解包,扩展名一般为.tar,指定特定参数可以调用gzip或bzip2制作压缩包或解开压缩包
-c 建立新的压缩包
-x 解压压缩包
-f 使用压缩包的名字,f参数之后不能再加参数
-i 忽略存档中的0字块
-v 处理过程中输出相关信息
-z 调用gzip来压缩归档文件,与-x联用时调用gzip完成解压缩
-j 调用bzip2压缩或解压
-p 使用源文件的原来属性
find -name '*.py' >> ~/a.list
tar -T a.list -zcvf a.tar.gz
tar -zcvf a.tar.gz a.list
链接命令
ln命令用来为文件创件链接,链接类型分为硬链接和符号链接两种,默认的链接类型是硬链接。如果要创建符号链接必须使用-s选项
注意:符号链接文件不是一个独立的文件,它的许多属性依赖于源文件,所以给符号链接文件设置存取权限是没有意义的
软链接只会在目的位置生成一个文件的链接文件,实际不会占用磁盘空间,相当于Windows中的快捷方式。硬链接会在目的位置上生成一个和源文件大小相同的文件。无论软链接和硬链接,文件保持同步变化。
-i 覆盖既有文件之前先询问用户
-s 创建符号(软)链接而不是硬链接
如果修改文件内容,那么链接会随着一起变化
如果删除源文件,硬链接可以继续使用,软链接失效
边栏推荐
- MySQL查看数据库性能常用命令
- [unity] built in rendering pipeline to URP
- 2022吴恩达机器学习specialization Week 2 practice lab: Linear regression
- [200 opencv routines] 213 Draw circle
- Who knows if it is safe to open an account with CSC securities
- To enhance the function of jupyter notebook, here are four tips
- [leetcode daily question] [December 19, 2021] 997 Find the town judge
- Unity loads AssetBundle resources from the server and writes them to local memory, and loads the downloaded and saved AB resources from local memory to the scene
- Please consult me. I run the MYSQL to MySQL full synchronization of flykcdc in my local ide. This is in my local ide
- Dear leaders, ask me if MySQL does not support early_ Offset mode? Unsupported star
猜你喜欢

Katalon当中的output使用方法

Realization of a springboard machine

解析:去中心化托管解决方案概述

卸载oracle报错
![[Unity]EBUSY: resource busy or locked](/img/72/d3e46a820796a48b458cd2d0a18f8f.png)
[Unity]EBUSY: resource busy or locked

Unity AssetBundle asset packaging and asset loading

MySQL cannot be opened. Flash back

Markdown -- basic usage syntax

【NLP】今年高考英语AI得分134,复旦武大校友这项研究有点意思
![[NLP] this year's college entrance examination English AI score is 134. The research of Fudan Wuda alumni is interesting](/img/a8/51b95432a9c8f25d8440cfd80926ce.png)
[NLP] this year's college entrance examination English AI score is 134. The research of Fudan Wuda alumni is interesting
随机推荐
Ffmpeg audio and video recording
一款自动生成单元测试的 IDEA 插件,开发效率提升 70% 以上!
无线通信模块定点传输-点对多点的具体传输应用
R语言使用car包中的avPlots函数创建变量添加图(Added-variable plots)、在图像交互中,在变量添加图中手动标识(添加)对于每一个预测变量影响较大的强影响点
sentinel
Six fusion positioning technologies in wireless communication application of Internet of things
Resolution: overview of decentralized hosting solution
2022吴恩达机器学习specialization Week 2 practice lab: Linear regression
手把手教你处理 JS 逆向之 SVG 映射
丢弃 Tkinter!简单配置快速生成超酷炫 GUI!
The R language uses the avplots function in the car package to create added variable plots. In image interaction, manually identify (add) strong influence points that have a great impact on each predi
idea连接sql sever失败
树莓派无需显示屏的VNC Viewer方式的远程连接
MySQL cannot be opened. Flash back
As shown in the figure, the SQL row is used to convert the original table of Figure 1. Figure 2 wants to convert it
卸载oracle报错
DlhSoft Kanban Library for WPF
Mysql database overview and installation process
增量快照 必须要求mysql表有主键的吗?
我大抵是卷上瘾了,横竖睡不着!竟让一个Bug,搞我两次!