tar命令简介-常用功能
2016-03-24 22:08
309 查看
tar命令是linux中非常实用的一个命令,是非常基础以及常用的。
本文只做非常简单和常用命令的介绍。如果需要了解完整用法,可以在linux终端中输入
tar命令一定要指定参数才能正确执行。
例如:
The options used most often with tar are as follows:
c Creates a new backup,overwriting any files already on the backup destination.
x Extracts files from backup media.
t Lists the contents of backup media.
v Displays the name of each file being processed.
f Creates backups on a specified device.
u Adds files to the backup if they are not already there,or if they have been modified since they were last written on the backup.
x 解压一个压缩包
v 执行命令过程中显示冗余(详细)信息
f 指定要被执行的文件
z 调用gzip联合来对文件进行压缩、解压
r 追加文件到压缩包中
zxvf 联合gzip解压文件并显示详细信息,被解压的文件名称应为*.tar.gz
cvf 压缩文件并显示详细信息,压缩包名称应该为*.tar
zvf 解压文件并显示详细信息,被解压的文件名称应为*.tar
tvf 显示压缩包中的文件详细列表
vf 显示压缩包中的文件
本文只做非常简单和常用命令的介绍。如果需要了解完整用法,可以在linux终端中输入
man tar或者
tar --useage或者
tar --help。
tar命令一定要指定参数才能正确执行。
tar命令的语法
tar [options][files]
例如:
tar zxvf test.tar.gz, 将压缩包test.tar.gz解压
tar cvf a.tar 1.txt 2.txt, 将1.txt和2.txt压缩到a.tar中
tar xvf a.tar,解压缩a.tar
tar tf a.tar, 列出a.tar中的文件
The options used most often with tar are as follows:
c Creates a new backup,overwriting any files already on the backup destination.
x Extracts files from backup media.
t Lists the contents of backup media.
v Displays the name of each file being processed.
f Creates backups on a specified device.
u Adds files to the backup if they are not already there,or if they have been modified since they were last written on the backup.
常用的参数
c 创建一个压缩包x 解压一个压缩包
v 执行命令过程中显示冗余(详细)信息
f 指定要被执行的文件
z 调用gzip联合来对文件进行压缩、解压
r 追加文件到压缩包中
最常用的参数组合
zcvf 联合gzip压缩文件并显示详细信息,压缩包名称应该为*.tar.gzzxvf 联合gzip解压文件并显示详细信息,被解压的文件名称应为*.tar.gz
cvf 压缩文件并显示详细信息,压缩包名称应该为*.tar
zvf 解压文件并显示详细信息,被解压的文件名称应为*.tar
tvf 显示压缩包中的文件详细列表
vf 显示压缩包中的文件
相关文章推荐
- Wire(聊天工具)
- 常用学习网站
- runtime(二)
- ThreadPoolExecutor使用
- 内存管理的一点补充笔记
- STM32启动代码分析 IAR 比较好
- Wire(聊天工具)
- Java深入解析读书笔记(一)
- 还有10天
- 八大排序之二分法插入排序
- 九大排序算法总结
- weblogic部署war包,log4j问题
- 学习进度表
- 解决Xcode 9.3系统真机测试时出现 could not find developer disk image问题
- ACM 数据结构入门
- 对象转换利器之Dozer
- 国家气象局提供的天气预报接口(国家气象局提供)
- SISD、MIMD、SIMD、MISD计算机的体系结构的Flynn分类法
- android 添加监听器失败
- 优秀的web前端工程师需要哪些软技能