0

I am trying to unzip a file and I am getting below error. am using gunzip -c filename command.

gunzip: DEX_DWH.zip: first entry not deflated or stored -- use unzip

Adding points : 1. I don't want to use unzip command . I want gunzip -c command to unzip the file. 2. This is how my code is defined

elif [[ ! "${FILECOMMAND}" ]] && [[ -f "${ZIPFILE}" || -f "${ZIPFILE3}" || -f "${ZIPFILE2}" || -f "${ZIPFILE4}" ]] then COMMANDTOUSE="gunzip -c"

FILECOMMAND - find the type of file and if its empty, gunzip -c comes into place.

  • 1
    The answer is right there in your question: use unzip – phemmer Nov 10 '14 at 18:39
  • 1
    You wrote "I don't want to use unzip command", but that is the core of your problem. gunzip can only unpack *.zip files that contain a single file and are either compressed using the deflate algorithm or not compressed at all ("stored"). Both methods are normally not used by zip, so you have to use unzip with most *.zip files. – Dubu Nov 11 '14 at 12:31
1

According to the file name, your file is a zip archive. For that, you need to use the unzip tool:

unzip DEX_DWH.zip -d DEX_DWH

This extracts the files into a new directory DEX_DWH. If you want to extract the files into the working directory instead, you do not need the -d DEX_DWH part.

The gzip utility is intended for working with gzip-compressed files (ie. not archives, for that you normally use tar before compressing/after decompressing).

0

You can use the file command to determine the file type to understand what tool you need to use to extract your archive.

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.