没有合适的资源?快使用搜索试试~ 我知道了~
linux之centos7打包与压缩命令详解
![star](https://csdnimg.cn/release/downloadcmsfe/public/img/star.98a08eaa.png)
温馨提示
本文介绍了常见的打包和压缩命令,包括打包命令tar和压缩命令gzip。打包命令tar可以将多个文件打包成一个文件,也可以将整个目录打包成一个文件,使用时需要指定选项来进行操作,如"-c"表示创建压缩包,"-x"表示解压缩包,"-t"表示列出压缩包内的文件列表,"-v"表示详细列出文件等。压缩命令gzip可以将文件进行压缩,使用时需要指定选项来进行操作,如"-d"表示解压缩文件,"-r"表示对目录进行递归压缩,"-z"表示使用gzip进行压缩。适用于Linux系统管理员和开发人员等人群,内容关键词包括打包、压缩、tar、gzip等。
资源推荐
资源详情
资源评论
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![application/x-zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![gz](https://img-home.csdnimg.cn/images/20210720083447.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![pdf](https://img-home.csdnimg.cn/images/20210720083512.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![application/x-rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![txt](https://img-home.csdnimg.cn/images/20210720083642.png)
![application/msword](https://img-home.csdnimg.cn/images/20210720083327.png)
![docx](https://img-home.csdnimg.cn/images/20210720083331.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![rar](https://img-home.csdnimg.cn/images/20210720083606.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![exe](https://img-home.csdnimg.cn/images/20210720083343.png)
![](https://csdnimg.cn/release/download_crawler_static/89211535/bg1.jpg)
打包与压缩详解
压缩与解压
Compress or uncompress FILEs (by default, compress FILES in-place)
1.1. Usage: gzip [OPTION]... [FILE]...
1.2. 常见选项
1.2.1. -d 解压 gzip -d xxx.txt.gz = gunzip xxx.txt.gz
1.2.2. -r, --recursive operate recursively on directories 对目录进行递归压缩(压缩目录内的
文件)
1.3. zcat xxx.txt.gz 查看压缩文件内容
打包与解压打包
saves many files together into a single tape or disk archive, and can restore individual files from
the archive(将许多文件一起保存到一个磁带或磁盘存档中,并且可以从存档中恢复单个文件)
Examples:
tar -cf 01.tar 0.txt 1.txt
tar -tvf 01.tar
tar -tf 01.tar
tar -xf 01.tar
tar -zcvf 01.tar.gz 0.txt 1.txt
tar -xcvf 01.tar.gz 0.txt 1.txt
tar -tvf 01.tar.gz
有-z 包名.tar.gz,无-z 包名.tar
tar -cvf 01.tar
tar -xvf 01.tar
tar -tvf 01.tar
常见选项
-C, --directory=DIR change to directory DIR 解压到指定目录下,如果指定目录不存
在报错(如果不写默认解压到当前目录下)
--exclude=PATTERN exclude files, given as a PATTERN
-t, --list list the contents of an archive 压缩包内文件列表
-z filter the archive through gzip 使用 gzip 压缩/解压
-c, --create create a new archive 创建压缩包
-v verbosely list files processed 详细列出文件
-x, --extract, --get extract files from an archive 解压
-f, --file=ARCHIVE use archive file or device ARCHIVE 指定压缩文件名/解压文件名
[root]# tar -tvf xxx.tar.gz
资源评论
![avatar-default](https://csdnimg.cn/release/downloadcmsfe/public/img/lazyLogo2.1882d7f4.png)
- baidu_169924412024-04-23对linux下的压缩与解压命令讲解十分详细,有实战代码演示,通俗易懂,值得收藏 #完美解决问题 #运行顺畅 #内容详尽 #全网独家 #注释完整
![avatar](https://profile-avatar.csdnimg.cn/bc3c40a1700d40bc91a04af0dc7133fa_weixin_41883161.jpg!1)
九转成圣
- 粉丝: 3134
- 资源: 2955
上传资源 快速赚钱
我的内容管理 展开
我的资源 快来上传第一个资源
我的收益
登录查看自己的收益我的积分 登录查看自己的积分
我的C币 登录后查看C币余额
我的收藏
我的下载
下载帮助
![voice](https://csdnimg.cn/release/downloadcmsfe/public/img/voice.245cc511.png)
![center-task](https://csdnimg.cn/release/downloadcmsfe/public/img/center-task.c2eda91a.png)
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback](https://img-home.csdnimg.cn/images/20220527035711.png)
![feedback-tip](https://img-home.csdnimg.cn/images/20220527035111.png)
安全验证
文档复制为VIP权益,开通VIP直接复制
![dialog-icon](https://csdnimg.cn/release/downloadcmsfe/public/img/green-success.6a4acb44.png)