tar命令

来源:互联网 发布:成本管理数据分析 编辑:程序博客网 时间:2024/05/17 07:48

压缩:

解压:

常见报错

1、tar -zxvf tftp_suse.tar

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error is not recoverable: exiting now

报上面错误原因是这个压缩包没有用gzip格式压缩,所以不用加z指令



[root@linux ~]# tar -cvf /tmp/etc.tar /etc <==仅打包,不压缩!
[root@linux ~]# tar -zcvf /tmp/etc.tar.gz /etc <==打包后,以 gzip 压缩
[root@linux ~]# tar -jcvf /tmp/etc.tar.bz2 /etc <==打包后,以 bzip2 压缩

0 0