8

I have a .gz folder and I tried to unzip it using terminal by the following commands, but gave error.

gunzip access-2.log.gz  
gzip -d access-2.log.gz  

gunzip gzip

Then I followed the error in Ask Ubuntu, found this question
After that I gave the command in terminal

gunzip Desktop/project/data/access-2.log.gz   

similar error.path

Why I'm getting this issue?
What is the solution to unzip the name.log.gz folder?

  • 8
    Run file access-2.log.gz, it will tell you the compression type. – kos Jan 2 '16 at 8:28
  • 1
    command 'file access-2.log.gz' gave : access-2.log.gz: UTF-8 Unicode text, with very long lines – NIMISHAN Jan 2 '16 at 8:31
  • 3
    Try head access-2.log.gz. Does it show the start of the log file? – Olathe Jan 2 '16 at 8:37
  • 1
    If the command proposed by Olathe doesn't show the start of the file please explain exactly how you compressed the file. gzip can compress only a single file at the time, it can't compress a folder or multiple files. – kos Jan 2 '16 at 8:44
  • 5
    That is the start of the log. Your file is not compressed, so it just has the wrong extension. mv access-2.log.gz access-2.log and the issue is solved. – kos Jan 2 '16 at 9:04
12

Its simple, I had the similar problem while ago, what I did was just rename the file.
that is to remove the .gz from the file name. Then it looks like access.log. So you can view it using any editor you have

| improve this answer | |

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.