标签:
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