linux 压缩文件 解压文件

https://blog.csdn.net/capecape/article/details/78548723

tar

-z(gzip)      用gzip来压缩/解压缩文件
-j(bzip2)     用bzip2来压缩/解压缩文件
-v(verbose)   详细报告tar处理的文件信息
-c(create)    创建新的档案文件
-x(extract)   解压缩文件或目录
-f(file)      使用档案文件或设备,这个选项通常是必选的。

压缩hello文件夹为hello.tar.gz文件:

#压缩
[root@localhost tmp]# tar -zvcf hello.tar.gz hello
[root@localhost tmp]# tar -jvcf hello.tar.bz2 hello

#解压
[root@localhost tmp]# tar -zvxf hello.tar.gz 
[root@localhost tmp]# tar -jvxf hello.tar.bz2

猜你喜欢

转载自blog.csdn.net/x1131230123/article/details/114028249