How to solve: This does not look like a tar archive

Problem:

Sometimes compressed files are not what they look from the extension. Recently I downloaded a .tar.gz file (say, we call it as filename.tar.gz) but when I tried to extract it, it gave error. It went something like this:

command: tar xvzf filename.tar.gz 
output: tar: This does not look like a tar archive 
tar: Skipping to next header 
tar: Exiting with failure status due to previous errors 

Reason:

The error says it all. This does not look like a tar archive. What does it look like than? The way to find it out is using “file” command in the following manner:

command: file filename.tar.gz 
output: filename.tar.gz: gzip compressed data,from Unix

Solution:

So here we go. a gzip compressed data. The best way to deal with it to use “unzip” command line tool. You can install it using this command:

sudo apt-get install gunzip 

Now loaded with gunzip we are ready to tackle this file. First gunzip the file to a .tar file and then untar it using tar command somewhat in following manner:

gunzip filename.tar.gz 
tar xvzf filename.tar 

Hope the post has helped you. Feedback, suggestions are most welcome. Enjoy :)

How to extract .tar.bz2 and .tar.gz file in Linux

Tar is an archiving utility in Linux. Lets see how can we extract various archived files in Linux using this utility.  We will also see the meaning of the options provided with the commands. Type the following commands in terminal (Keyboard short cut: Ctrl+Alt+T in Ubuntu):

Extracting .tar.bz2:

tar xvjf filename.tar.bz2 location

Extracting .tar.gz:

tar xvzf filename.tar.gz location

Where:

x — extract

v — verbose (it will show the extracting files in the terminal)

f — file

z — gzip (or gz in short)

j — bzip2 (or bz2 in short)

location — location where you want to save the extracted the files. If you want to save it in the same directory where you have the zipped file use “.” in place of “location”.

All extracted files will be kept in a single directory automatically. The name of this directory is decided by the zipped file itself.

Hope the post has helped you. Feedback, suggestions are most welcome. Enjoy :)

How to run ex_ file by converting ex_ to exe file

Recently I came across a new type of file format which is “ex_” instead of “exe“. First I tried executing it by simply renaming it from “filename.ex_” to “filename.exe” but it did not work that way. “ex_” is actually compressed form of “exe” files and they need to be expanded. The most suitable way is to use command line. Follow the given steps:

  • Open the command prompt by going to “Start->All Programs->Accessories->Run” and then type “cmd” in Run window. Run can also be opened by pressing “Windows button + r
  • In the command prompt go to the folder where your file “filename.ex_” is stored. For ease I would suggest you to manually copy the file into C drive. Make a new folder named say “new
  • If you are in different directory than C then type “cd ..” and press enter. Do it a couple of time until you are :C directory.
  • Now use the command: expand filename.ex_ c:newfilename.exe
  • This command may result in following error: EXPAND.EXE Error Msg: Can’t Open Output File
  • The reason is very simple. You might not have write permission for the “filename.ex_” or for the folder “new” or for both
  • Right click on the file/folder and select properties. If the “Read Only” box is checked, de-select it.
  • Now run the previous command again. Use the expanded file in .exe format wherever you want.

Questions and Suggestions are welcomed. Enjoy :)

Sources: Microsoft