I zipped a directory on my Mac OSX with the zip
command line and -r
option. I scp
the .zip
to a cluster operating on Linux.
If I try to decompress the .zip
with
tar -vxzf foo.zip
on my machine it works. But the same command doesn't work on the cluster. I get the error
gzip: stdin has more than one entry--rest ignored
tar: Child returned status 2
tar: Error is not recoverable: exiting now
How can I solve this issue?
If you're already familiar with zip files, this should be pretty easy to get because they work in the same way. While a zip file has the extension . zip, a tar file can have .
Simply right-click the item you want to compress, mouseover compress, and choose tar. gz. You can also right-click a tar. gz file, mouseover extract, and select an option to unpack the archive.
tar gz is better for Linux/Unix as it retains permissions, such as "executable" on scripts. OS X's Archive Utility and zip / unzip preserve permissions, but there might be other utilities that don't.
The tar
command is for unpacking TAR archives, not zip files. You should either use the unzip
command instead of tar
:
unzip foo.zip
Or make a tar.gz
archive on the Mac side instead of a zip file
tar -cvzf foo.tar.gz ....
which you can unpack with your existing tar
command on the Linux side.
This error :
gzip: stdin has more than one entry--rest ignored
Means that tar
is trying to decompress your zip archive as if it was a gzip archive, that doesn't always work (see "Files created by zip can be uncompressed by gzip only if they have a single member compressed with the 'deflation' method" for more info).
You should use unzip foo.zip
instead to decompress a zip archive.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With