LinuxQuestions.org
Latest LQ Deal: Linux Power User 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 01-23-2013, 09:34 PM   #1
Panceisto
LQ Newbie
 
Registered: Mar 2010
Distribution: Debian
Posts: 12

Rep: Reputation: 0
how to list file contents bz2 file


Hi All,

how can I list the files in a bz2 archive? (not a tar)

Thanks
 
Old 01-23-2013, 09:56 PM   #2
hilyard
Member
 
Registered: Jan 2010
Location: Inland PNW
Distribution: Lite | siduction
Posts: 291

Rep: Reputation: 66
see
PHP Code:
bzip2 --help 
 
Old 01-23-2013, 10:01 PM   #3
Panceisto
LQ Newbie
 
Registered: Mar 2010
Distribution: Debian
Posts: 12

Original Poster
Rep: Reputation: 0
This is what bzip2 --help gives me:

-h --help print this message
-d --decompress force decompression
-z --compress force compression
-k --keep keep (don't delete) input files
-f --force overwrite existing output files
-t --test test compressed file integrity
-c --stdout output to standard out
-q --quiet suppress noncritical error messages
-v --verbose be verbose (a 2nd -v gives more)
-L --license display software version & license
-V --version display software version & license
-s --small use less memory (at most 2500k)
-1 .. -9 set block size to 100k .. 900k
--fast alias for -1
--best alias for -9

I assume you are suggesting I use one of the above flags to list the file contents. Which one?

Thanks
 
Old 01-23-2013, 10:17 PM   #4
hilyard
Member
 
Registered: Jan 2010
Location: Inland PNW
Distribution: Lite | siduction
Posts: 291

Rep: Reputation: 66
-t
Not so much to see content as to see where an install will place which files.
If wanting to see what the file contains, use an archive manager like xarchiver and just click on the file (careful not to install)or open the archiver and place the file in it.

Last edited by hilyard; 01-23-2013 at 10:20 PM.
 
Old 01-23-2013, 10:18 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,326

Rep: Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364
Looking at http://linux.die.net/man/1/bzcat (& http://www.cyberciti.biz/faq/unix-li...nts-of-tarbz2/) I'm pretty sure that bzip2 is just a compression algorithm, ie it does not create archives of many files saved in one big file, but individually compresses each file separately, in the same manner as gzip.

Of course someone could have sent you an archive (technically a .tar.bz2 or .tbz2) & just called it blah.bz2.
Easiest way to check is
Code:
file yourfilename
http://linux.die.net/man/1/file
 
1 members found this post helpful.
Old 01-23-2013, 10:40 PM   #6
Panceisto
LQ Newbie
 
Registered: Mar 2010
Distribution: Debian
Posts: 12

Original Poster
Rep: Reputation: 0
Chris:
Quote:
Looking at http://linux.die.net/man/1/bzcat (& http://www.cyberciti.biz/faq/unix-li...nts-of-tarbz2/) I'm pretty sure that bzip2 is just a compression algorithm, ie it does not create archives of many files saved in one big file, but individually compresses each file separately, in the same manner as gzip.

Of course someone could have sent you an archive (technically a .tar.bz2 or .tbz2) & just called it blah.bz2.
Easiest way to check is
Thanks, not a tar unfortunately.
 
Old 01-24-2013, 01:20 AM   #7
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,326

Rep: Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364Reputation: 2364
What does the file cmd say?
 
Old 01-24-2013, 02:18 AM   #8
JJJCR
Senior Member
 
Registered: Apr 2010
Posts: 1,163

Rep: Reputation: 194Reputation: 194
you don't want to extract?

if you want to extract check out this thread: http://www.linuxquestions.org/questi...2-file-161371/

if you want to just list the files, try this link: http://www.cyberciti.biz/faq/unix-li...nts-of-tarbz2/
 
Old 01-24-2013, 06:42 AM   #9
jkirchner
Member
 
Registered: Apr 2007
Location: West Virginia
Posts: 773

Rep: Reputation: 199Reputation: 199
use bzcat. If you do
Code:
man bzip2
you can read about bzcat. It is like cat but for bz2 files
 
1 members found this post helpful.
  


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
Compare two folders(recursively) for file names and file contents alaios Linux - Software 5 05-04-2012 01:40 AM
[SOLVED] Using Expect/TCL to move contents of a text file to an executable file jefsa Linux - Newbie 4 04-20-2012 10:43 AM
How do you overwrite the contents of a file without changing the file size? lothario Linux - Software 3 07-13-2010 08:43 AM
Bash remove part of a file based on contents of another file bhepdogg Programming 4 01-31-2007 03:13 PM
'Read-only file system' when untar a tar.bz2 file yinglcs Linux - General 1 02-18-2006 09:12 PM


All times are GMT -5. The time now is 02:38 AM.

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