[expert] Unzipping a file
How do I unpack a file with a .tar.bz2 extension? Thanks, Wayne
Re: [expert] Unzipping a file
bunzip2 file.tar.bz2 then tar -xvf file.tar Keith -- There's ease of use and then there's ease of usefulness. Choose usefulness. Choose Linux. On Wed, 12 Apr 2000, Wayne Petherick wrote: > How do I unpack a file with a .tar.bz2 extension? > > Thanks, > > Wayne >
Re: [expert] Unzipping a file
Wayne Petherick wrote: > > How do I unpack a file with a .tar.bz2 extension? bzip2 -cd | tar -xf - -- Jean-Louis Debert[EMAIL PROTECTED] 74 Annemasse France old Linux fan
Re: [expert] Unzipping a file
I think ark works for that, it worked on my system at least once. On Wed, 12 Apr 2000, Wayne Petherick mewed: > How do I unpack a file with a .tar.bz2 extension? > > Thanks, > > Wayne -- Sign up for ClickDough and get paid to surf the web. http://secure.clickdough.com/servlets/cr/CRSignup.po?referral_id=kittypuss
Re: [expert] Unzipping a file
On Wed, 12 Apr 2000, you wrote: > How do I unpack a file with a .tar.bz2 extension? > bzip2 -d then tar xvf as normal. John
Re: [expert] Unzipping a file
Wayne Petherick wrote: > How do I unpack a file with a .tar.bz2 extension? > Read the documentation. There are man pages for bzip2 and tar. That's the general recommendation for what to do, [first]. However, I'll give you a little rap session on tar. I haven't used bzip2 and bunzip2, yet, because I mostly work with gzip and therefore gunzip; however, the tar part I've deal with before, and it's easy to learn from the man page. Tip on unarchiving tar files or tar balls: The command is (drumroll please) ... % tar xvf {filename}.tar If it's the only tar file in the directory, then the following will also work (drumroll, again, please) ... % tar xvf *.tar If you want to view the contents of the tar file or ball without unarchiving, then use tvf, instead of xvf. x => extraction and t=> toc (table of contents). If you unarchive, delete the .tar file, and then decide you need to re-tar, then copy the files to a separate, empty directory and run the following % tar cv * -f {filename}.tar {filename} of course being what ever you want to name the file. For bz2 decompression and compression, refer to the man page on bzip2: % man bzip2 The bzip2 executables or programs should be in one of your bin or sbin directories, either under / or /usr. If you don't find the bzip2 programs, then you'll need to install them from the cdrom, and if not there, then download and install. There are other tools which can be used and kpackage might work for this. I believe that it works for .gz files (not entirely sure, though, because I haven't explored kpackage much, yet); however, it does work for .tar archives and rpm (supposedly for rpm anyway). If you're using kde and want to investigate this alternative, then bring up kpackage and try it against your .tar.bz2 file. That's the fairly comprehensive pov from arrogant moi. Just kidding, i.e., joking. Don't mind me, I joke once in a while; although, it ain't no joke that you didn't bother reading the man pages, first. Tsk, tsk. If you want to become at all fluent with Linux/Unix, then you need to use the reference documentation and learn about all there is and how to access the different forms or formats. There's man, xman, info, as well as kde Help, and other tools. After learning the basic Linux/Unix commands, like cd, pwd, cp, rm, mv, cat, echo, id, who, whoami or "who am i" (for those who forget who they are - joking, kind of), ..., the next first lesson in learning to use Linux/Unix systems are the documentation resources. mike
Re: [expert] Unzipping a file
Wayne Petherick wrote: > How do I unpack a file with a .tar.bz2 extension? > Quickly, you can do it one of two ways. $ bzcat file.tar.bz2 | tar x or $ tar yxf file.tar.bz2 The first way uses "bzcat" to print out the uncompressed contents of the .tar.bz2 file. Meaning that it's printing a tar file to standard out. You're then piping the the output to tar, which extracts the contents of the tar file. The second method uses the "y" option of tar, which tells tar to use "bunzip2" to decompress the archive before un-tarring it. Mandrake compiled tar with built-in support for bzip2 archives, which is why you can use the "y" option. This will not work in all systems. -Matt Stegman <[EMAIL PROTECTED]>
Re: [expert] Unzipping a file
Matt Stegman wrote: > Quickly, you can do it one of two ways. > > $ bzcat file.tar.bz2 | tar x No. This will not work: you must tell tar that it is given a file through standard input (tar's default input is the tape device, /dev/st0) The correct command is: $ bzcat file.tar.bz2 | tar xf - -- Jean-Louis Debert[EMAIL PROTECTED] 74 Annemasse France old Linux fan
Re: [expert] Unzipping a file
I find .tar.gzip and .tgz files much more convenient becuase of the integrated support for the gzip: tar xvzf foo.tgz does the whole thing. This makes .tar.bz2 file, in my opinion, a lot less pleasent thatn .tar.gzip files, even if they are slightly smaller. Is there a version of tar with integrated .bzip support someplace? But the answer the original question, the easist way is bzcat foo.tar.gz2 | tar xvf - Mike Corbeil wrote: > > Wayne Petherick wrote: > > > How do I unpack a file with a .tar.bz2 extension? > > > > Read the documentation. There are man pages for bzip2 and tar. > > That's the general recommendation for what to do, [first]. However, > I'll give you a little rap session on tar. I haven't used bzip2 and > bunzip2, yet, because I mostly work with gzip and therefore gunzip; > however, the tar part I've deal with before, and it's easy to learn from > the man page. > > Tip on unarchiving tar files or tar balls: The command is (drumroll > please) ... > > % tar xvf {filename}.tar > > If it's the only tar file in the directory, then the following will also > work (drumroll, again, please) ... > > % tar xvf *.tar > > If you want to view the contents of the tar file or ball without > unarchiving, then use tvf, instead of xvf. x => extraction and t=> toc > (table of contents). > > If you unarchive, delete the .tar file, and then decide you need to > re-tar, then copy the files to a separate, empty directory and run the > following > > % tar cv * -f {filename}.tar > > {filename} of course being what ever you want to name the file. > > For bz2 decompression and compression, refer to the man page on bzip2: > > % man bzip2 > > The bzip2 executables or programs should be in one of your bin or sbin > directories, either under / or /usr. If you don't find the bzip2 > programs, then you'll need to install them from the cdrom, and if not > there, then download and install. > > There are other tools which can be used and kpackage might work for > this. I believe that it works for .gz files (not entirely sure, though, > because I haven't explored kpackage much, yet); however, it does work > for .tar archives and rpm (supposedly for rpm anyway). > > If you're using kde and want to investigate this alternative, then bring > up kpackage and try it against your .tar.bz2 file. > > That's the fairly comprehensive pov from arrogant moi. Just kidding, > i.e., joking. Don't mind me, I joke once in a while; although, it ain't > no joke that you didn't bother reading the man pages, first. Tsk, tsk. > > If you want to become at all fluent with Linux/Unix, then you need to > use the reference documentation and learn about all there is and how to > access the different forms or formats. There's man, xman, info, as well > as kde Help, and other tools. After learning the basic Linux/Unix > commands, like cd, pwd, cp, rm, mv, cat, echo, id, who, whoami or "who > am i" (for those who forget who they are - joking, kind of), ..., the > next first lesson in learning to use Linux/Unix systems are the > documentation resources. > > mike -- "Brian, the man from babble-on" [EMAIL PROTECTED] Brian T. Schellenberger http://www.babbleon.org Support http://www.eff.org. Support decss defendents. Support http://www.programming-freedom.org. Boycott amazon.com.
Re: [expert] Unzipping a file
> > $ bzcat file.tar.bz2 | tar x > > No. This will not work: > ... > The correct command is: > > $ bzcat file.tar.bz2 | tar xf - They both work on my (Mdk 7.0) system. Perhaps Mandrake compiled tar to default to standard in, instead of the tape device? -Matt Stegman <[EMAIL PROTECTED]>
Re: [expert] Unzipping a file
In the vain hope of forestalling a number of "you moron" followups, I will point out that I saw the recent posting explaining that there's a "y" option that does exactly this. In my defense, it's not in the "man" page. Yeah, I'm more a Unix person than a Linux person, so I checked "man" rather than "info." But I checked "info" just now and it's even worse: It claims that the "I" option does bzip rather than the "y" option. PS: Does anybody know of a utility that will translate info into man format? "Brian T. Schellenberger" wrote: > > I find .tar.gzip and .tgz files much more convenient becuase of the > integrated support for the gzip: > >tar xvzf foo.tgz > > does the whole thing. > > This makes .tar.bz2 file, in my opinion, a lot less pleasent thatn > .tar.gzip files, even if they are slightly smaller. > > Is there a version of tar with integrated .bzip support someplace? > > But the answer the original question, the easist way is > >bzcat foo.tar.gz2 | tar xvf - > > Mike Corbeil wrote: > > > > Wayne Petherick wrote: > > > > > How do I unpack a file with a .tar.bz2 extension? > > > > > > > Read the documentation. There are man pages for bzip2 and tar. > > > > That's the general recommendation for what to do, [first]. However, > > I'll give you a little rap session on tar. I haven't used bzip2 and > > bunzip2, yet, because I mostly work with gzip and therefore gunzip; > > however, the tar part I've deal with before, and it's easy to learn from > > the man page. > > > > Tip on unarchiving tar files or tar balls: The command is (drumroll > > please) ... > > > > % tar xvf {filename}.tar > > > > If it's the only tar file in the directory, then the following will also > > work (drumroll, again, please) ... > > > > % tar xvf *.tar > > > > If you want to view the contents of the tar file or ball without > > unarchiving, then use tvf, instead of xvf. x => extraction and t=> toc > > (table of contents). > > > > If you unarchive, delete the .tar file, and then decide you need to > > re-tar, then copy the files to a separate, empty directory and run the > > following > > > > % tar cv * -f {filename}.tar > > > > {filename} of course being what ever you want to name the file. > > > > For bz2 decompression and compression, refer to the man page on bzip2: > > > > % man bzip2 > > > > The bzip2 executables or programs should be in one of your bin or sbin > > directories, either under / or /usr. If you don't find the bzip2 > > programs, then you'll need to install them from the cdrom, and if not > > there, then download and install. > > > > There are other tools which can be used and kpackage might work for > > this. I believe that it works for .gz files (not entirely sure, though, > > because I haven't explored kpackage much, yet); however, it does work > > for .tar archives and rpm (supposedly for rpm anyway). > > > > If you're using kde and want to investigate this alternative, then bring > > up kpackage and try it against your .tar.bz2 file. > > > > That's the fairly comprehensive pov from arrogant moi. Just kidding, > > i.e., joking. Don't mind me, I joke once in a while; although, it ain't > > no joke that you didn't bother reading the man pages, first. Tsk, tsk. > > > > If you want to become at all fluent with Linux/Unix, then you need to > > use the reference documentation and learn about all there is and how to > > access the different forms or formats. There's man, xman, info, as well > > as kde Help, and other tools. After learning the basic Linux/Unix > > commands, like cd, pwd, cp, rm, mv, cat, echo, id, who, whoami or "who > > am i" (for those who forget who they are - joking, kind of), ..., the > > next first lesson in learning to use Linux/Unix systems are the > > documentation resources. > > > > mike > > -- > "Brian, the man from babble-on" [EMAIL PROTECTED] > Brian T. Schellenberger http://www.babbleon.org > Support http://www.eff.org. Support decss > defendents. > Support http://www.programming-freedom.org. Boycott amazon.com. -- "Brian, the man from babble-on" [EMAIL PROTECTED] Brian T. Schellenberger http://www.babbleon.org Support http://www.eff.org. Support decss defendents. Support http://www.programming-freedom.org. Boycott amazon.com.
Re: [expert] Unzipping a file
On Thu, Apr 13, 2000 at 13:48 -0400, Brian T. Schellenberger wrote: > Yeah, I'm more a Unix person than a Linux person, so I checked "man" > rather than "info." But I checked "info" just now and it's even worse: > It claims that the "I" option does bzip rather than the "y" option. You're right. >From 'info tar': 'tar' Options - [.] '--bzip2' '-I' This option tells 'tar' to read or write archives through 'bzip2'. [.] $ tar --version tar (GNU tar) 1.13.11 (from the Mandrake 7.0 distro) Happy tarring ;-) wobo -- GPG-Fingerprint: FE5A 0891 7027 8D1B 4E3F 73C1 AD9B D732 A698 82EE For Public Key mailto [EMAIL PROTECTED] with Subject: GPG-Request --- ISDN4LINUX-FAQ -- Deutsch: http://www.wolf-b.de/i4l/i4lfaq-de.html
Re: [expert] Unzipping a file
Brian T. Schellenberger wrote: > In the vain hope of forestalling a number of "you moron" followups, I > will point out that I saw the recent posting explaining that there's a > "y" option that does exactly this. In my defense, it's not in the "man" > page. man or documentation page bug. y option for what? I just checked the man pages for tar and bzip2 and also didn't see any mention of a y option. > Yeah, I'm more a Unix person than a Linux person, so I checked "man" > rather than "info." But I checked "info" just now and it's even worse: > It claims that the "I" option does bzip rather than the "y" option. Why not just use bzip2 and tar separately? Or are you talking about some other tool? Sounds like the option -I would be related to tar, and if this is the case, then I'ld just stick with using the tools separately. > PS: Does anybody know of a utility that will translate info into man > format? Am unaware, of such a tool. Just checked and didn't find any for info to man, but did find pod2man; therefore, if there's a way of getting info converted to man, then it would probably be through an indirect route, perhaps info to dvi or ps, then dvi or ps to pod or man, etcetera, for example. info might also have this information. You might find an answer in the texinfo documentation, which you may or probably have a directory for under /usr/doc. Am not certain if texinfo is related to info, but this documentation should quickly answer this additional question. Actually, I just checked and there isn't much to speak of there; however, the LDP should have documentation. You may find the following documentation of some use, maybe: man mkmanifest (top where it explains - somewhat - how this man page was created) info texinfo Nonetheless, does bzip2 or bunzip2 not work for un-bz2'ing your file? If you're using kde, then have you tried kpackage or karchive, or some other kde utility or tool? > "Brian T. Schellenberger" wrote: > > > > I find .tar.gzip and .tgz files much more convenient becuase of the > > integrated support for the gzip: > > > >tar xvzf foo.tgz > > > > does the whole thing. Yep. The only reason I haven't used this more than once is because I already knew tar and gzip, don't need all tar files zipped, don't do tar'ing and zip'ing an extraordinary amount, and using the tools separately means needing to remember one less option. If I used both functions combined, often, then I'ld use only tar with xvzf. Alas, dude, it's mostly a free world. > > But the answer the original question, the easist way is > > > >bzcat foo.tar.gz2 | tar xvf - Depends on what the person wants to do and it's .bz2. Besides, that's really no easier than the following, or at least not so much easier that it's worthy of note: % bunzip2 foo.tar.gz2 ; tar xvf foo.tar (or running the two commands from separate prompts) Showing newbies the many various ways of running commands as per the Unix ways is good, I guess; however, if people are going to complain about a nano-second of difference in time, then go ahead. At the end of the week, you'll have saved a whole few nano- or micro-seconds. I mostly prefer the practical approach. If you want to sit at work all day trying to figure out how to make your dog do all sorts of tricks, then go right ahead. Until you're accountable to me, I don't care how you spend your time, and I've never worked in such (permissive) environments. Besides the trick I prefer to teach dogs is to stop barking unnecessarily. >From one moron to another, mike P.S. Huff & puff and the big bad wolf blew the little piggies' house down. Rude wolf, I'll say.
Re: [expert] Unzipping a file
Brian, tar can interface directly with bzip2 as needed: tar -cvf --use-compress-program bzip2 * tar -xvf --use-compress-program bzip2 It all works beautifully (except that bzip2, as you would expect, takes a very very very long time to do its job). "Brian T. Schellenberger" wrote: > > I find .tar.gzip and .tgz files much more convenient becuase of the > integrated support for the gzip: > >tar xvzf foo.tgz > > does the whole thing. > > This makes .tar.bz2 file, in my opinion, a lot less pleasent thatn > .tar.gzip files, even if they are slightly smaller. > > Is there a version of tar with integrated .bzip support someplace? -- Regards, Ron. [AU] - sent by Linux.
Re: [expert] Unzipping a file
Ron Stodden wrote: > Brian, > > tar can interface directly with bzip2 as needed: > > tar -cvf --use-compress-program bzip2 * > tar -xvf --use-compress-program bzip2 > > It all works beautifully (except that bzip2, as you would expect, > takes a very very very long time to do its job). > Does bzip2 take any longer than gzip? Also, that's one way to do what that does, however the following may be a little easier to write tar cvf bzip2 and bunzip2 .bz2 tar xvf The - isn't necessary for cvf and xvf, albeit because most programs require at least one -, it's easier for newbies to remember to use the - with tar, than to not use the -. I don't know of any other programs or utilities which don't require the - to specify options, albeit do like the idea. It's kind of like the Perl saying "there are many ways to do it" (it being what ever). Otherwise, what's the comparative report on the differences between bzip2 and gzip? I think that it was Brian who said that gzip produces slightly less compressed sizes, but other than that up not up on the comparative stats for compression tools. What ever happened to cpio? This one seems to have been the least popular, but worked fine for me when I last used it. From what I recall, cpio was the alternative to tar on Unix platforms, and was thought to be sometimes better than tar. mike
Re: [expert] Unzipping a file
Mike Corbeil wrote: > > Does bzip2 take any longer than gzip? > Yes. TANSTAAFL ... bzip2 is based on arithmetic compression which is more CPU-intensive but produces better compression than gzip which is based on an enhanced LZW algorithm. > What ever happened to cpio? This one seems to have been the least > popular, but worked fine for me when I last used it. From what I > recall, cpio was the alternative to tar on Unix platforms, and was > thought to be sometimes better than tar. cpio still exists, and is used in most Linux distributions, because it's one of the components in the rpm package. -- Jean-Louis Debert[EMAIL PROTECTED] 74 Annemasse France old Linux fan
Re: [expert] Unzipping a file
Mike Corbeil wrote: > > Brian T. Schellenberger wrote: > > > In the vain hope of forestalling a number of "you moron" followups, I > > will point out that I saw the recent posting explaining that there's a > > "y" option that does exactly this. In my defense, it's not in the "man" > > page. > > man or documentation page bug. > > y option for what? I just checked the man pages for tar and bzip2 and also > didn't see any mention of a y option. Yes, exactly. tar xvyf foo.tar.bz2 extracts and unzips in a single step. Cool, eh? Undocumented, alas. > > > Yeah, I'm more a Unix person than a Linux person, so I checked "man" > > rather than "info." But I checked "info" just now and it's even worse: > > It claims that the "I" option does bzip rather than the "y" option. > > Why not just use bzip2 and tar separately? Or are you talking about some other > tool? Well, that way I save *two* steps: 1. bunzip 2. rm the expanded tar file. Plus sometimes I save a third step: 3 Finding a parition big enough for the expanded file to go. > > > "Brian T. Schellenberger" wrote: > > > > > > I find .tar.gzip and .tgz files much more convenient becuase of the > > > integrated support for the gzip: > > > > > >tar xvzf foo.tgz > > > > > > does the whole thing. > > Yep. The only reason I haven't used this more than once is because I already > knew tar and gzip, don't need all tar files zipped, don't do tar'ing and > zip'ing an extraordinary amount, and using the tools separately means needing > to remember one less option. If I used both functions combined, often, then > I'ld use only tar with xvzf. > > Alas, dude, it's mostly a free world. > > > > But the answer the original question, the easist way is > > > > > >bzcat foo.tar.gz2 | tar xvf - > > Depends on what the person wants to do and it's .bz2. > > Besides, that's really no easier than the following, or at least not so much > easier that it's worthy of note: > > % bunzip2 foo.tar.gz2 ; tar xvf foo.tar But then you need to recompress it when you're done or waste a boatload of disk space. No matter how big my disks get I never seem to have boatloads of empty disk space, at least not in the partitions were I really need them. > (or running the two commands from separate prompts) > And I'd argue that this is easier for newbies, who don't really have much call for using gzip/bzip/gunzip/bunzip/bcat/zcat anyway . . . an extra option is surely easier. Though 'twould be even better if tar just recognized the magic numbers and acted accordingly. Though OTOH this is the expert list, so I'm not sure if the needs of newbies are relavent. -- "Brian, the man from babble-on" [EMAIL PROTECTED] Brian T. Schellenberger http://www.babbleon.org Support http://www.eff.org. Support decss defendents. Support http://www.programming-freedom.org. Boycott amazon.com.
Re: [expert] Unzipping a file
Brian T. Schellenberger wrote: > Mike Corbeil wrote: > > > > Brian T. Schellenberger wrote: > > > > > In the vain hope of forestalling a number of "you moron" followups, I > > > will point out that I saw the recent posting explaining that there's a > > > "y" option that does exactly this. In my defense, it's not in the "man" > > > page. > > > > man or documentation page bug. > > > > y option for what? I just checked the man pages for tar and bzip2 and also > > didn't see any mention of a y option. > > Yes, exactly. > > tar xvyf foo.tar.bz2 > > extracts and unzips in a single step. > > Cool, eh? Undocumented, alas. I found some documentation yesterday which gave such examples and I believe that was in the LDP web site. This means that it's documented, except not locally. However, people can mirror the LDP, or download it, or copy it, to have it accessible locally, instead of always needing to hook up to the internet to get to the LDP. Wasn't sure how much I'ld use the documentation, but copied it to my local /usr/doc directory, organized the documentation by categorizing into directories to speed up searches, and it's been useful. Now, I just bring up kfm, as long as I'm using kde, and browse, locally. The only potential problem with that is needing to check once in a while to see if documentation has been added or changed, but most of the documentation is dated, which helps to make the checking fairly quick to do. I agree that it's quicker to use the extra option with tar, and that it may be more useful the way you described. I just haven't had the need to bother, and also wonder if the option is also available with tar on Unix, like Sun, ... One can always try and if it doesn't work, then read the man page, but what if it works, but does something different? Am not sure and I don't have a Unix system available to check. Just some thoughts; although, I don't think they'ld change the meaning or effect of an option for a Unix command, for this reason. The other aspect of copying the LDP and such documentation locally is (besides making sure not to infringe upon copyrights) creating a script or tool to provide one fairly consistent user interface and which searches man pages, info, and all other local documentation files, to locate documentation. This would create one integrated documentation search and display user interface, albeit the various types of documentation would be presented according to what ever tool or type of tool is otherwise used to view the documentation when it's accessed more directly, or directly. I have most of such a script already completed, but presently have higher priorities and need to create a gui front end, before this tool is finished. Also, maybe there already is such a tool, but I'm not aware of one; therefore, this tool is agenda'd, among other things which are also deferred due to higher or more urgent priorities. Without a tool like this, a user must try man, info, and if these fail, then bring up a browser, or use rgrep, to search through the many HOWTOs, FAQs, and other copied documentation. One integrated u.i. seems like a nicer approach. Then, whether people copy documentation from the internet or not, is up to each to choose. Documentation is definitely nice to have, especially up to date documentation, and free documentation puts icing on the cake. mike