0
点赞
收藏
分享

微信扫一扫

linux(压缩,解压)

半夜放水 2022-01-04 阅读 70

gzip/gunzip

gzip a.txt #压缩文件
gzip /home/test #会将test下的每一个文件进行压缩

需要注意的是gzip只会压缩不会打包,

zip/unzip

zip -r test.zip /test/ #将test包含的子文件及本身压缩为一个文件
unzip test.zip 
unzip -d /home/test /root/test.zip #将test解压到/home/test中

tar

tar -zcvf test.gz /home/test #将test目录压缩,压缩包名字为test.gz
tar -zxvf test.gz #解压
tar -zxvf test.gz -C /home/test #解压到指定目录
举报

相关推荐

0 条评论