学习目标:
对linux压缩打包进行复习
学习内容:
#linux系统下解压文件的时候,不同格式的压缩包需要使用不同的命令来解压或者压缩。
一、tar
#Linux最常用的压缩和解压指令是:
tar:能够解压的文件格式是 xx.tar.gz
压缩:tar -zcf 压缩包路径 目标1 目标2 目标3 ...
解压:tar -zxf 解压路径
例子1:压缩和解压文件
[root@localhost ~]# ls
123.txt 4.txt a.txt c.txt jaden.txt
1.txt anaconda-ks.cfg b.txt jaden.tar.gz services
[root@localhost ~]# rm -f *
[root@localhost ~]# ls
[root@localhost ~]# cp /etc/services .
[root@localhost ~]# tar -zcf jaden.tar.gz services #压缩文件
[root@localhost ~]# ls
jaden.tar.gz services
[root@localho