macos - 无法在 ubuntu VM 上解压缩 tar.gz

标签 macos unix ubuntu tar

执行以下步骤:-

  1. 主机是 Mac OS X 10.6.8
  2. git archive -o version-$SHA.tar.gz HEAD
  3. scp 版本-$SHA.tar.gz $Remote_location
  4. ssh 到远程位置,即在 ubuntu VM 上
  5. tar -zxf version-$SHA.tar.gz

第 5 步后出现错误:-

gzip: stdin: 不是 gzip 格式

tar: child 返回​​状态 1

tar:错误不可恢复:现在退出

可能是什么问题?在我的本地 Mac 机器上,同样的命令有效。

最佳答案

引自 the manpage :

--format= Format of the resulting archive: tar or zip. If this option is not given, and the output file is specified, the format is inferred from the filename if possible (e.g. writing to "foo.zip" makes the output to be in the zip format). Otherwise the output format is tar.

所以您得到的可能是一个未压缩的 .tar 文件,只是命名为 .tar.gz。

尝试不使用 -z 参数。

关于macos - 无法在 ubuntu VM 上解压缩 tar.gz,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17746146/

相关文章:

postgresql - 使用保存的密码从远程计算机使用 psql 连接到远程 postgres 数据库

ubuntu - 打开终结器,但是有根终端

mysql查询在两个不同的系统上返回不同的结果

python - Pyinstaller 无法在 Python2.7 64 位 Ubuntu 中编译大型程序

在mac终端找不到android命令

c++ - 将编译器标志传递给需要编译的 boost 库(例如 Thread)

macos - 在OSX上安装gnuplot 5.0.1

C unix,套接字上的非对称加密

linux - 使用 putty/ssh 并利用 grep -rn 有没有一种方法可以精确搜索

java - Mac Mavericks Java 无法找到可执行文件 bash_profile 编辑不起作用