LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-08-2009, 04:29 AM   #1
idaham
LQ Newbie
 
Registered: Aug 2009
Posts: 26

Rep: Reputation: 0
How to unzip binary tar-file?


Hello!

I've downloaded a file which should contain text. The file is zipped however, but not with the simple extension "tar.gz", "tar.bz2" or something like that, but it has extension "tar.bin". The only thing I've ever done in linux regarding zipping (did I mention I'm quite new to linux? =) ) is unzipping tar.gz-files...

The information about the file (from where I download it) is:
Code:
Name: MaterialsDB.tar.bz2
Type: application/x-bzip2
Size: 16974 bytes
Desc: 2249912135-MaterialsDB.tar.bz2
Url : http://lists.healthgrid.org/archives/gate-users/attachments/20080114/50ef5240/MaterialsDB.tar-0001.bin
As you can see, the file you download is NOT "MaterialsDB.tar.bz2", but "MaterialsDB.tar-0001.bin". What is this weird format, and how can I get to the text contents??

Thanks!
Ida
 
Old 10-08-2009, 04:34 AM   #2
lutusp
Member
 
Registered: Sep 2009
Distribution: Fedora
Posts: 835

Rep: Reputation: 102Reputation: 102
Quote:
Originally Posted by idaham View Post
Hello!

I've downloaded a file which should contain text. The file is zipped however, but not with the simple extension "tar.gz", "tar.bz2" or something like that, but it has extension "tar.bin". The only thing I've ever done in linux regarding zipping (did I mention I'm quite new to linux? =) ) is unzipping tar.gz-files...

The information about the file (from where I download it) is:
Code:
Name: MaterialsDB.tar.bz2
Type: application/x-bzip2
Size: 16974 bytes
Desc: 2249912135-MaterialsDB.tar.bz2
Url : http://lists.healthgrid.org/archives/gate-users/attachments/20080114/50ef5240/MaterialsDB.tar-0001.bin
As you can see, the file you download is NOT "MaterialsDB.tar.bz2", but "MaterialsDB.tar-0001.bin". What is this weird format, and how can I get to the text contents??

Thanks!
Ida
First, find out what kind of file it is:

Code:
$ file (filename)
This should tell you how to proceed.

If the file is a gzipped archive, unpack it this way:

Code:
$ tar -xzf (filename)
If the file is a tar file without compression, do this:

Code:
$ tar -xf (filename)
If the file is a bz2-compressed tar archive, do this:

Code:
$ tar -xjf (filename)
And so forth.
 
Old 10-08-2009, 04:36 AM   #3
mathew_p_a
LQ Newbie
 
Registered: Oct 2009
Posts: 7
Blog Entries: 1

Rep: Reputation: 1
bin file

If the file is a binary file, then you can execute the file akin to exe files in windows.

just change your directory to the files location and execute


./filename.bin
 
Old 10-08-2009, 05:27 AM   #4
idaham
LQ Newbie
 
Registered: Aug 2009
Posts: 26

Original Poster
Rep: Reputation: 0
Hi lutusp!

Thanks, your suggestion "$ file" told me it was a bzip2 compressed data, and "$ tar -xjf (filename)" worked like a charm! =)
Cheers,
Ida

Quote:
Originally Posted by lutusp View Post
First, find out what kind of file it is:

Code:
$ file (filename)
This should tell you how to proceed.

If the file is a gzipped archive, unpack it this way:

Code:
$ tar -xzf (filename)
If the file is a tar file without compression, do this:

Code:
$ tar -xf (filename)
If the file is a bz2-compressed tar archive, do this:

Code:
$ tar -xjf (filename)
And so forth.
 
Old 10-08-2009, 07:25 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,412

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
Interesting, normally a .bin extension means its self-extracting ie you just

chmod u+x x.bin
./x.bin

and it self-extracts.
If you've still got a copy of the orig .bin, you might want to try that somewhere safe.
 
Old 10-08-2009, 07:29 PM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
A self extracting executable binary file would have been identified by the file command as an elf file. The extension of the file was just wrong.
 
Old 10-08-2009, 07:30 PM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,412

Rep: Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397Reputation: 2397
Ok; I can't remember the last time I've actually had to deal with one.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
what is .tar file format and how do i unzip it jafryar Linux - Newbie 5 12-01-2007 06:45 PM
how to unzip a ***.tar.bz2 file in Windows RajRed General 17 11-04-2005 10:47 AM
D/l a .tgz.tar file..how to unzip Navop Linux - Newbie 1 03-13-2005 08:56 AM
Why can't I unzip a .tar.gz file Dewar Linux - Software 8 09-18-2003 05:07 PM
unzip a tar.gz file klfreese Linux - Newbie 1 07-23-2003 12:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:05 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration