Ubuntu:这看起来不像 tar 存档

Zab*_*abs 5 unix ubuntu

在使用 sudo wget 命令下载 tar 文件后,我尝试运行以下命令以在 Ubuntu 机器上安装 CasperJS。

sudo tar -xvf casperjs.tar

This does not look like a tar archive
Skipping to next header
Exiting with failure status due to previous errors
Run Code Online (Sandbox Code Playgroud)

我需要以不同方式运行原始 sudo tar 命令吗?

Oli*_*lac 5

看看你得到了什么:

file casperjs.tar
Run Code Online (Sandbox Code Playgroud)

然后查看其内容(如果它是 tar 文件):

tar tvf casperjs.tar
tar tvzf casperjs.tar  #if that was a gzip-ed tar file
tar tvbf casperjs.tar  #if that was a bzip-ed tar file
tar tvZf casperjs.tar  #if that was a compress-ed tar file  #now very unlikely...
 #note that after the 'f', you need to have a SEPARATOR (space, or tab) followed by the FILENAME. 
 #ie, you can't place an option after the f
 #ex: "tar tvfz something.tar.gz", would try to open file "z" instead and find "something.tar.gz" inside it...
Run Code Online (Sandbox Code Playgroud)

然后将“t”更改为“x”来提取(不过,我建议首先使用“t”......)