老李分享:《Linux Shell脚本攻略》 要点(五)
2015-12-16 16:18
489 查看
老李分享:《Linux Shell脚本攻略》 要点(五)
//1、打包、解包[root@localhost program_test]# tar -cf output.tar 11.txt 22.txt 33.txt [root@localhost program_test]# tar -xf output.tar -C ./tar-file/ //-C指定要提取到哪个路径?//列举出归档文件中的内容[root@localhost program_test]# tar -tvf output2.tar-rw-rw-r-- yy/yy 101843 2014-12-18 07:40 33.txt
drwxrwxr-x yy/yy 0 2014-12-31 18:11 abc/
-rw-rw-r-- yy/yy 0 2014-12-31 18:11 abc/def//[root@localhost program_test]# tar -tf output.tar
11.txt
22.txt
33.txt
33.txt
abc/
abc/def//删除给定归档文件中的文件
[root@localhost program_test]# tar -f output.tar --delete 33.txt
[root@localhost program_test]# tar -tf output.tar
11.txt
22.txt
abc/
abc/def 2、压缩//批量打包和压缩的实现[root@localhost touch_more]# cat gzip_all_files.sh#!/bin/bashtextfiles=`ls | grep ".txt" | xargs` echo $textfilesfor textfile in $textfiles;do tar -rvf archive.tar $textfile //以追加的形式打包文件.done gzip archive.tar //压缩归档文件
相关文章推荐
- 老李性能测试分享
- 你想不到:咖啡馆里上工具课
- 移动端自动化测试开课了
- 老李分享:什么是好战略
- 性能调优案例分享:Mysql的cpu过高
- 性能测试分享:性能测试工具开发的案例分享(上)
- 性能测试分享:性能测试工具开发的案例分享(下)
- 性能测试培训:批量执行Jmeter脚本之ant调用 2
- 性能测试培训:分布式测试之jmeter1
- 老李案例分享:MAT分析应用程序服务出现内存溢出过程1
- 老李案例分享:MAT分析应用程序服务出现内存溢出过程2
- 老李案例分享:定位JAVA内存溢出 1
- 老李案例分享:定位JAVA内存溢出 2
- 性能测试培训: 建立压力模型
- 老李分享:你知道有哪些持续集成工具
- 老李分享知识:性能测试之TPS和吞吐率
- 老李分享知识:性能测试之吞吐量
- 性能测试培训:分析内训泄露的案例
- 自动化测试培训:qtp脚本获取获取汇率数据
- 性能测试培训:sql server性能测试分析局部变量的性能影响1