windows 系统下压缩⽂件通常是 zip 、 rar 等格式; Linux 系统压缩⽂件通常为 tar.gz(tar 包 ) ,tar 指令完成 linux 系统的⽂件压缩和解压
指令说明:
z: ⽤gzip⼯具进⾏压缩或者解压x: extract 解压缩c: compress 压缩v: verbose显示压缩/解压过程详细信息f: file 文件
tar -zcvf 压缩
tar -zcvf test1.tar test1 #对test1⽬录进⾏压缩,压缩到test1.tar⽂件
tar -zcvf test.tar test1 test2 #将test1和test2进⾏压缩,压缩到test.tar⽂件
tar -zxvf 解压
tar -zxvf test.tar tar -zxvf 解压