Linux命令-tar

时间:2016-09-07 15:50:43   收藏:0   阅读:206
tar -zcvf 压缩包名.tar.gz 文件名
tar -zxvf 压缩包名.tar.gz

 

[root@localhost testB]# ls
111.txt  222.txt

将111.txt文件通过gzip打包保存文件名111.tar.gz [root@localhost testB]# tar zcvf
111.tar.gz 111.txt 111.txt [root@localhost testB]# ls 111.tar.gz 111.txt 222.txt [root@localhost testB]# rm -rf 111.txt [root@localhost testB]# ls 111.tar.gz 222.txt
解压111.tar.gz到当前目录
[root@localhost testB]# tar zxvf
111.tar.gz 111.txt [root@localhost testB]# ls 111.tar.gz 111.txt 222.txt
解压111.tar.gz到指定目录/root/testC下 [root@localhost testB]# tar
-zxvf 111.tar.gz -C /root/testC/ 111.txt [root@localhost testB]# ll /root/testC/ 总用量 4 -rw-r--r--. 1 root root 3 9月 7 15:23 111.txt

 

原文:http://www.cnblogs.com/tdcqma/p/5849721.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!