Unzip gz archives with zip extension

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
6
down vote

favorite
1












I have a number of gzip archives; however they have a zip extension not gz:
***.zip



When I try to unzip them with unzip, I get not a zip archive error, and with gunzip I get unknown suffix: zip



What is going on here really?










share|improve this question



















  • 2




    Is there any reason that you can't rename the files to have a .gz extension?
    – Ben Sandeen
    Oct 9 '17 at 22:29














up vote
6
down vote

favorite
1












I have a number of gzip archives; however they have a zip extension not gz:
***.zip



When I try to unzip them with unzip, I get not a zip archive error, and with gunzip I get unknown suffix: zip



What is going on here really?










share|improve this question



















  • 2




    Is there any reason that you can't rename the files to have a .gz extension?
    – Ben Sandeen
    Oct 9 '17 at 22:29












up vote
6
down vote

favorite
1









up vote
6
down vote

favorite
1






1





I have a number of gzip archives; however they have a zip extension not gz:
***.zip



When I try to unzip them with unzip, I get not a zip archive error, and with gunzip I get unknown suffix: zip



What is going on here really?










share|improve this question















I have a number of gzip archives; however they have a zip extension not gz:
***.zip



When I try to unzip them with unzip, I get not a zip archive error, and with gunzip I get unknown suffix: zip



What is going on here really?







zip gzip






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Oct 9 '17 at 23:12









Jeff Schaller

32.3k849109




32.3k849109










asked Oct 9 '17 at 15:05









perestroika

3112




3112







  • 2




    Is there any reason that you can't rename the files to have a .gz extension?
    – Ben Sandeen
    Oct 9 '17 at 22:29












  • 2




    Is there any reason that you can't rename the files to have a .gz extension?
    – Ben Sandeen
    Oct 9 '17 at 22:29







2




2




Is there any reason that you can't rename the files to have a .gz extension?
– Ben Sandeen
Oct 9 '17 at 22:29




Is there any reason that you can't rename the files to have a .gz extension?
– Ben Sandeen
Oct 9 '17 at 22:29










1 Answer
1






active

oldest

votes

















up vote
10
down vote













By default, gzip will only decompress files with extensions from a limited list—rather than examining the file magic to determine if it is a gzip'd file. From a comment in gzip.c:get_suffix():



/* ======================================================================== 
* Return a pointer to the 'z' suffix of a file name, or NULL. For all
* systems, ".gz", ".z", ".Z", ".taz", ".tgz", "-gz", "-z" and "_z" are
* accepted suffixes, in addition to the value of the --suffix option.


To use input files which are in fact gzip'd but are not named following gzip's expected conventions, provide the suffix explicitly as per the gzip manual page:




-S .suf --suffix .suf



... When decompressing, add .suf to the beginning of the list of suffixes to try, when deriving an output file name from an input file name.




$ gunzip -S .zip foo.zip


or use redirection to prevent gzip from seeing the filename:



$ gunzip < foo.zip > foo.txt





share|improve this answer






















  • +1 for a cause - but why not cat file.zip | gunzip > file.ext for the quick lazy way of doing it? And if cat will interrupt due to the "special" characters that would show in a binary, would dd work in its place - dd if=filezame.zip | gunzip > filename.ext
    – ivanivan
    Oct 10 '17 at 1:39










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f397044%2funzip-gz-archives-with-zip-extension%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
10
down vote













By default, gzip will only decompress files with extensions from a limited list—rather than examining the file magic to determine if it is a gzip'd file. From a comment in gzip.c:get_suffix():



/* ======================================================================== 
* Return a pointer to the 'z' suffix of a file name, or NULL. For all
* systems, ".gz", ".z", ".Z", ".taz", ".tgz", "-gz", "-z" and "_z" are
* accepted suffixes, in addition to the value of the --suffix option.


To use input files which are in fact gzip'd but are not named following gzip's expected conventions, provide the suffix explicitly as per the gzip manual page:




-S .suf --suffix .suf



... When decompressing, add .suf to the beginning of the list of suffixes to try, when deriving an output file name from an input file name.




$ gunzip -S .zip foo.zip


or use redirection to prevent gzip from seeing the filename:



$ gunzip < foo.zip > foo.txt





share|improve this answer






















  • +1 for a cause - but why not cat file.zip | gunzip > file.ext for the quick lazy way of doing it? And if cat will interrupt due to the "special" characters that would show in a binary, would dd work in its place - dd if=filezame.zip | gunzip > filename.ext
    – ivanivan
    Oct 10 '17 at 1:39














up vote
10
down vote













By default, gzip will only decompress files with extensions from a limited list—rather than examining the file magic to determine if it is a gzip'd file. From a comment in gzip.c:get_suffix():



/* ======================================================================== 
* Return a pointer to the 'z' suffix of a file name, or NULL. For all
* systems, ".gz", ".z", ".Z", ".taz", ".tgz", "-gz", "-z" and "_z" are
* accepted suffixes, in addition to the value of the --suffix option.


To use input files which are in fact gzip'd but are not named following gzip's expected conventions, provide the suffix explicitly as per the gzip manual page:




-S .suf --suffix .suf



... When decompressing, add .suf to the beginning of the list of suffixes to try, when deriving an output file name from an input file name.




$ gunzip -S .zip foo.zip


or use redirection to prevent gzip from seeing the filename:



$ gunzip < foo.zip > foo.txt





share|improve this answer






















  • +1 for a cause - but why not cat file.zip | gunzip > file.ext for the quick lazy way of doing it? And if cat will interrupt due to the "special" characters that would show in a binary, would dd work in its place - dd if=filezame.zip | gunzip > filename.ext
    – ivanivan
    Oct 10 '17 at 1:39












up vote
10
down vote










up vote
10
down vote









By default, gzip will only decompress files with extensions from a limited list—rather than examining the file magic to determine if it is a gzip'd file. From a comment in gzip.c:get_suffix():



/* ======================================================================== 
* Return a pointer to the 'z' suffix of a file name, or NULL. For all
* systems, ".gz", ".z", ".Z", ".taz", ".tgz", "-gz", "-z" and "_z" are
* accepted suffixes, in addition to the value of the --suffix option.


To use input files which are in fact gzip'd but are not named following gzip's expected conventions, provide the suffix explicitly as per the gzip manual page:




-S .suf --suffix .suf



... When decompressing, add .suf to the beginning of the list of suffixes to try, when deriving an output file name from an input file name.




$ gunzip -S .zip foo.zip


or use redirection to prevent gzip from seeing the filename:



$ gunzip < foo.zip > foo.txt





share|improve this answer














By default, gzip will only decompress files with extensions from a limited list—rather than examining the file magic to determine if it is a gzip'd file. From a comment in gzip.c:get_suffix():



/* ======================================================================== 
* Return a pointer to the 'z' suffix of a file name, or NULL. For all
* systems, ".gz", ".z", ".Z", ".taz", ".tgz", "-gz", "-z" and "_z" are
* accepted suffixes, in addition to the value of the --suffix option.


To use input files which are in fact gzip'd but are not named following gzip's expected conventions, provide the suffix explicitly as per the gzip manual page:




-S .suf --suffix .suf



... When decompressing, add .suf to the beginning of the list of suffixes to try, when deriving an output file name from an input file name.




$ gunzip -S .zip foo.zip


or use redirection to prevent gzip from seeing the filename:



$ gunzip < foo.zip > foo.txt






share|improve this answer














share|improve this answer



share|improve this answer








edited Oct 9 '17 at 15:40

























answered Oct 9 '17 at 15:28









user4556274

4,98811123




4,98811123











  • +1 for a cause - but why not cat file.zip | gunzip > file.ext for the quick lazy way of doing it? And if cat will interrupt due to the "special" characters that would show in a binary, would dd work in its place - dd if=filezame.zip | gunzip > filename.ext
    – ivanivan
    Oct 10 '17 at 1:39
















  • +1 for a cause - but why not cat file.zip | gunzip > file.ext for the quick lazy way of doing it? And if cat will interrupt due to the "special" characters that would show in a binary, would dd work in its place - dd if=filezame.zip | gunzip > filename.ext
    – ivanivan
    Oct 10 '17 at 1:39















+1 for a cause - but why not cat file.zip | gunzip > file.ext for the quick lazy way of doing it? And if cat will interrupt due to the "special" characters that would show in a binary, would dd work in its place - dd if=filezame.zip | gunzip > filename.ext
– ivanivan
Oct 10 '17 at 1:39




+1 for a cause - but why not cat file.zip | gunzip > file.ext for the quick lazy way of doing it? And if cat will interrupt due to the "special" characters that would show in a binary, would dd work in its place - dd if=filezame.zip | gunzip > filename.ext
– ivanivan
Oct 10 '17 at 1:39

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f397044%2funzip-gz-archives-with-zip-extension%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Bahrain

Postfix configuration issue with fips on centos 7; mailgun relay