Q. I've downloaded a file from internet in .tgz format. How do I decompress .tgz file under UNIX or Linux operating system using a shell prompt?
A. This is archive file also known as tar ball. If an archive is compressed with an external tool, the compression program adds its own suffix as usual, resulting in filename endings like ".tar.Z", ".tar.gz", and ".tar.bz2"
or tgz. To open such file type the following command at Linux shell prompt (GNU tar syntax):
$ tar -zxvf filename.tgz
$ tar -zxvf filename.tar.gz
$ tar -jxvf filename.tar.bz2
UNIX decompress tgz / tar.gz file
Type the following command:
$ gzip -dc filename.tgz | tar xf -
$ gzip -dc filename.tar.gz | tar xf -
If file extension ends with .Z, enter:
$ zcat filename.tar.Z | tar xf -
转自:http://www.cyberciti.biz/faq/decompress-tgz-targz-files/
本文介绍了如何在UNIX或Linux系统中使用shell命令解压.tgz格式的文件。提供了具体的命令示例,包括使用tar和gzip命令解压不同类型的压缩文件。
3261

被折叠的 条评论
为什么被折叠?



