4

I have a .gz file called document.txt.gz file. It is supposed to be a text file which got compressed to a gzip file. When I uncompress, I am getting a corrupt file.

I ran the following commands:

$ file document.txt.gz

and the result is

document.txt.gz: gzip compressed data, max speed, from FAT filesystem (MS-DOS, OS/2, NT)

and I again ran the file command on the unzipped portion

$ file document.txt.gz

and the result is

document.txt: gzip compressed data, last modified: Mon Mar 12 22:16:42 2018, from Unix

I am unsure why my uncompressed file is still a gzip compressed data.

Is there a way to retrieve the original file?

Morpheus
  • 163
  • 1
  • 2
  • 9
  • 3
    It looks to me that you run `file document.txt.gz` twice and get two different results. Could you please clarify what you are doing. Also, what does `gunzip document.txt.gz` say (if it does not create `document.txt`)? – Kusalananda May 25 '18 at 05:36
  • 4
    Which command do you use to uncompress the file? – dr_ May 25 '18 at 08:27

1 Answers1

5

In your case decompress the file by gzip -d document.txt.gz The -d flag is used to indicate the decompression or uncompression.

Read the man page of gzip for more information.

Good luck!