700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > 6.5 zip压缩工具;6.6 tar打包;6.7 打包并压缩

6.5 zip压缩工具;6.6 tar打包;6.7 打包并压缩

时间:2021-12-07 02:22:38

相关推荐

6.5 zip压缩工具;6.6 tar打包;6.7 打包并压缩

6.5 zip压缩工具

yum安装zip压缩工具:

[root@hao-01 ~]# yum install -y zip

1. zip压缩文件:zip 压缩文件名 原文件

[root@hao-01 ~]# zip hao.txt.zip hao.txt

2. zip压缩目录:zip -r 压缩目录名 原目录

[root@hao-01 ~]# zip -r mulu1.zip mulu

yum安装zip解压工具:

[root@hao-01 ~]# yum install -y unzip

3. zip解压文件:unzip .zip压缩文件

[root@hao-01 ~]# unzip hao.txt.zip

4. zip解压文件,同时解压到指定路径:

unzip .zip压缩文件 -d 解压指定路径

[root@hao-01 ~]# unzip hao.txt.zip -d /tmp

5. zip解压目录:unzip .zip目录压缩包

[root@hao-01 ~]# unzip mulu.zip

6. zip解压目录,同时解压到指定路径:

unzip .zip目录压缩包 -d 解压指定路径

[root@hao-01 ~]# unzip mulu.zip -d /tmp

7. 列出zip目录压缩包 的文件列表:

unzip -l .zip目录压缩包

[root@hao-01 ~]# unzip -l mulu.zip

6.6tar打包

1. tar打包目录:tar -cvf 目录包名 原目录

(v 的作用,可视打包过程,可以不添加!)

[root@hao-01 ~]# tar -cvf mulu.tar mulu1

2. tar解包.tar包:tar -xvf .tar包

[root@hao-01 ~]# tar -xvf mulu.tar

3. tar同时打包目录和文件: tar -cvf 目录包名 原目录 文件

[root@hao-01 ~]# tar -cvf mulu.tar mulu hao.txt

4. 查看.tar目录包 的文件列表: tar -tf tar目录包

[root@hao-01 ~]# tar -tf mulu.tar

5. tar打包目录,同时过滤目录中的文件或目录不进行打包!:

tar -cvf 目录包名 --exclude 过滤文件 --exclude 过滤目录 原目录

[root@hao-01 ~]# tar -cvf mulu.tar --exclude 22.txt --exclude mulu3 mulu

6. tar打包目录,同时过滤目录中的所有后缀带有.txt的文件 不进行打包!:

tar -cvf 目录包名 --exclude ".txt" 原目录

[root@hao-01 ~]# tar -cvf mulu.txt --exclude ".txt" mulu

6.7打包并压缩

tar打包并gzip压缩

1. tar打包并gzip压缩:

tar -zcvf .tar.gz打包压缩包名 文件 原目录

[root@hao-01 ~]# tar -zcvf mulu.tar.gz hao.txt mulu

2. gzip解压缩并tar解包:

tar -zxvf .tar.gz打包压缩包

[root@hao-01 ~]# tar -zxvf mulu.tar.gz

3. 列出.tar.gz打包压缩包 的文件列表:

tar -tf .tar.gz打包压缩包

[root@hao-01 ~]# tar -tf mulu1.tar.gz

tar打包并bzip2压缩

1. tar打包并bzip2压缩:

tar -jcvf .tar.bz2打包压缩包名 文件 原目录

[root@hao-01 ~]# tar -jcvf mulu.tar.bz2 hao.txt mulu

2. gzip解压缩并bzip2解包:

tar -jxvf .tar.bz2打包压缩包

[root@hao-01 ~]# tar -jxvf mulu.tar.bz2

3. 列出.tar.bzip2打包压缩包 的文件列表:

tar -tf .tar.bz2打包压缩包

[root@hao-01 ~]# tar -tf mulu1.tar.bz2

tar打包并xz压缩

1. tar打包并xz压缩:

tar -Jcvf .tar.xz打包压缩包名 文件 原目录

[root@hao-01 ~]# tar -Jcvf mulu.tar.xz hao.txt mulu

2. gzip解压缩并xz解包:

tar -Jxvf .tar.xz打包压缩包

[root@hao-01 ~]# tar -Jxvf mulu.tar.xz

3. 列出.tar.xz打包压缩包 的文件列表:

tar -tf .tar.xz打包压缩包

[root@hao-01 ~]# tar -tf mulu1.tar.xz

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。