Linux 解压 tar.gz 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/16356460/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 22:50:58  来源:igfitidea点击:

Uncompress tar.gz file

linuxubuntudebian

提问by dali1985

With the usage of wget command line I got a tar.gz file. I downloaded it in the root@raspberrypi. Is there any way to uncompress it in the /usr/src folder?

通过使用 wget 命令行,我得到了一个 tar.gz 文件。我在 root@raspberrypi 中下载了它。有没有办法在 /usr/src 文件夹中解压它?

采纳答案by qingchen

Use -Coption of tar:

使用-Ctar 选项:

tar zxvf <yourfile>.tar.gz -C /usr/src/

and then, the content of the tar should be in:

然后,焦油的内容应该在:

/usr/src/<yourfile>

回答by dratewka

Try this:

尝试这个:

tar -zxvf file.tar.gz

回答by Satya

gunzip <filename>

then

然后

tar -xvf <tar-file-name>