0

I had a file (was a text file at first), did xxd -r to it and saved it to tempfile2. Afterwards did file tempfile2 and it wrote:

tempfile2: gzip compressed data, was "data2.bin", from Unix, last modified: Fri Nov 14 10:32:20 2014, max compression

I tried:

gzip -d tempfile2>tempfile3
gzip -d tempfile2.gz > tempfile3
gzip -d tempfile2.gz > tempfile3.gz
gunzip tempfile2
gunzip tempfile2.gz
gunzip tempfile2 > tempfile3

... all combinations possible.

neither of that worked. It either said no such file in directory or unknown suffix -- ignored

  • What if you try to rename the file? Maybe there is a white space at the end of the file name you can check this using double quotes.... – Luciano Andress Martini May 30 '16 at 20:47
  • tried that already... file name has nothing to do with it (thnx for editing b.t.w, the format of adding code here is annoying) – Hacktivator May 30 '16 at 20:53
  • cat -v tempfile2.gz | tail , what it returns (please dont use tail directly you not want this believe me). – Luciano Andress Martini May 30 '16 at 20:57
  • @JuliePelletier Please look up what the -r option does to xxd – Anthon May 31 '16 at 5:06
6

You don't have a tempfile2.gz you only have a tempfile2.

Decompress by doing

gzip -d  < tempfile2 > tempfile3

Normally gzip would expect a .gz file for decompression and so you can do

mv tempfile2 tempfile2.gz
gzip -d tempfile2.gz

which would give you an uncompressed tempfile2. Or you could do

mv tempfile2 tempfile2.gz
gzip -cd tempfile2.gz > tempfile3

the -c making sure the output is written to standard output. Or do

zcat tempfile2 > tempfile3

so you don't need to provide any options, for which picking the correct ones seem the source of your problems.

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.