Bash Shell解压文件

Bash Shell解压文件,你需要解压一个或多个扩展名为 .tar.tar.gz.gz.tgz.Z.zip 的文件。

解决方案

先搞清楚要处理的文件,然后选择正确的工具。下表 列出了常见的扩展名以及能够处理该类文件的程序。此时 file 命令可以派上用场,它能告诉你文件是哪种类型,哪怕是文件名有误。

常见的文件扩展名和压缩工具

Bash Shell解压文件

你也不妨试试 file 命令。

$ file what_is_this.*
what_is_this.1: GNU tar archive
what_is_this.2: gzip compressed data, from Unix

$ gunzip what_is_this.2
gunzip: what_is_this.2: unknown suffix -- ignored

$ mv what_is_this.2 what_is_this.2.gz

$ gunzip what_is_this.2.gz

$ file what_is_this.2
what_is_this.2: GNU tar archive

讨论

如果文件扩展名不在 上表 中,而且 file 命令也无济于事,但你确信该文件属于某种归档,那不妨在网上搜一下。

酷客网相关文章:

赞(0)

评论 抢沙发

评论前必须登录!