2 years ago

#37731

test-img

Neutrino Watson

Linux unzip command fails to unzip file

I have a zip file named test_kit.zip which contains a shell script deploy.sh inside it. The shell script file has read, write and, execute permission.

I want to unzip this test_kit.zip file

  1. Using jar xf or 7zip
jar xf test_kit.zip
7za x test_kit.zip

These commands unzip the zip file correctly but, the deploy.sh shell script loses the execute permission. Is there any way to unzip using 'jar xf' or '7za x' without losing execute permission for the files and folders inside the zip file?

  1. Using unzip
unzip test_kit.zip

This command gives me an error which is as follows-

warning [test_kit.zip]:  1318507533 extra bytes at beginning or within zipfile
  (attempting to process anyway)
error [test_kit.zip]:  start of central directory not found;
  zipfile corrupt.
  (please check that you have transferred or created the zipfile in the
  appropriate BINARY mode and that you have compiled UnZip properly)

I want to understand what is going wrong.

linux

shell

jar

zip

unzip

0 Answers

Your Answer

Accepted video resources