范例一:将整个 /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 压缩

 

相关文章: