在linux下面使用tar命令解压以及压缩文件!!!
使用tar --help可以看到如下信息。
GNU `tar' saves many files together into a single tape or disk archive, and
can restore individual files from the archive.
Usage: tar [OPTION]... [FILE]...
Examples:
tar -cf archive.tar foo bar # Create archive.tar from files foo and bar.
tar -tvf archive.tar # List all files in archive.tar verbosely.
tar -xf archive.tar # Extract all files from archive.tar.
……
这里简要介绍几个重要选项。
-c选项,新建一个压缩文件
-x选项,解压缩文件。
下面看到 tar -cf [file]
tar -xf [file]
分别就是压缩文件和解压缩文件了。
除了这个,可能需要压缩其他格式文件了,
如-j/-z选项
-j, --bzip2 filter the archive through bzip2
-z, --gzip, --ungzip filter the archive through gzip
-j选项表明压缩文件的格式为bzip2,-z选项代表的是gzip选项
其余还有一些,我都还没有弄清楚具体意思,知道的帮忙补充啦!!!