打包 压缩 命令tar zip

范例一:将整个 /etc 目录下的档案全部打包成为 /tmp/etc.tar

[root@linux ~]# tar -cvf /tmp/etc.tar /etc  <==仅打包,不压缩!

[root@linux ~]# tar -czvf /tmp/etc.tar.gz /etc  <==打包后,以 gzip 压缩

[root@linux ~]# tar -cjvf /tmp/etc.tar.bz2 /etc  <==打包后,以 bzip2 压缩

猜你喜欢

转载自www.cnblogs.com/chengjunhao/p/9088693.html