0

Is there any way to unzip the file in Linux without being through the unzip command?

We can not install the software unzip or any decompressor for now and need to unpack some files in a script that was created.

I used the jar -xf file.zip command in a ZIP file with several files inside, however only the first file was extracted and the error below was presented in the terminal, any idea what it might be?

java.io.IOException: Push back buffer is full
        at java.io.PushbackInputStream.unread(PushbackInputStream.java:215)
        at java.util.zip.ZipInputStream.readEnd(ZipInputStream.java:367)
        at java.util.zip.ZipInputStream.read(ZipInputStream.java:156)
        at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:100)
        at sun.tools.jar.Main.extractFile(Main.java:936)
        at sun.tools.jar.Main.extract(Main.java:852)
        at sun.tools.jar.Main.run(Main.java:242)
        at sun.tools.jar.Main.main(Main.java:1149)

When I ran the jar tvf file.zip command, I was able to see everything inside file.zip.

  • 1
    Looks like you may have a corrupt zip file. – Andrew Henle May 10 '18 at 18:42
  • You may have 7z, or in you have a Graphical UI, it may have an archive decompressor (ark in KDE) or the navigator can natively handle ZIP files as diectories (dolphin in KDE). – xenoid May 10 '18 at 20:29
1

If you cannot install the necessary software on the target machine, consider moving the ZIP file to a machine that already has the necessary software. (ZIP extractors available not only on Linux machines but Windows and Mac too.)

Then either repack the files using a compatible compressor or copy the extracted bundle back again. There are file transfer tools available for just about any platform you can name.

0

Sounds like the jar file may be corrupt in some regard.

To get unzip made available on the server, install unzip package on another server, and then scp the /usr/bin/unzip to /tmp/myunzip on your troubled server, and then just use that binary.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.