options with tar -j -z are optional
Hi,
I tried to untar bz2 and gz files with tar -xf x.tar.bz2 tar -xf y.tar.gz on OpenSuse 11.2 Both worked properly without -j or -z options ! When i search the net, I saw that every document writer is bent on specifying the -j and -z options with the respective files ! does it improve the quality or performance coz. i didnt see any one doing a tar without these options ?? |
That works for me on Fedora.
It must automatically detect the .bz2 of .gz extension, or maybe bz2 or gz's magic number. That's actually very convenient for me because I often get confused with those 'j' and 'z' flags. And there is no way that performance is reduced, because a 'gz' file and a 'tar' file are completely unrelated formats. Unlike the Windows .zip format leads you to think, compression and archiving are completely separate tasks. It's just that bzip2 and gzip are only compression formats. That is, they just compress a single stream of bytes, and they do not have the functionality to store information about a directory tree in there. tar is just an archiving format. It's only purpose is to turn a directory tree into a single file/stream of bytes, that can later be decoded back into a directory tree. It is not a compression algorithm. You can actually sometimes see bzip2 or gzip being used without tar to compress a single file. |
Quote:
The magic lies in the name of the file. Tar automatically selects the compression format as gunzip or bunzip using the file name. that is if you want to compress some files Code:
$tar -cvf myfiles.tar.bz *.jpg similarly for gunzip Code:
$tar -cvf myfiles.tar.gz *.jpg This hold for extracting also. |
Since a few versions ago(1.16/1.18 ?), tar autodetects the compression type according to the filename.
|
The ' tar ' flags changed five years ago ...
From /usr/doc/tar-1.15.1/NEWS , slack 10.2 Quote:
No more jxvf or zxvf is required . ! ..... |
I backported that functionality to tar-1.13 for use with pkgtools -along with the switches for supporting bzip2, lzma and xz.
|
Quote:
Sadly, I'm an *-buntu guy and not slackware. I might fetch your sources and see how much hackery is needed to create a DEB file ... no where is that box of round tuits? Cheers, ~~~ *<;-}( )( )// |
Funny that this gz/bz2 auto-detecting functionality doesn't seem to be mentioned in my man page for tar, even though my version of tar does have the functionality.
|
Thanks to all of u for throwing light on the subject !
Quote:
|
MTK358, tar is a GNU program so it is documented with an info page. Any man-page you have for tar is leftover from 10 years ago, or added by your distro. That reminds me to check and make sure mine has been updated with the last changes I made.
SaintDanBert, just since the latest version released last week, src2pkg does support creating debs, rpms and other formats and is available as an installable package in all these format also. You can get the debian package here: http://distro.ibiblio.org/pub/linux/...2.0-16_all.deb I'd be very glad to hear any feedback from you as it hasn't been tried on most other systems yet. Please email me directly if you have any problems, suggestions or comments: amigo AT ibiblio.org Gilbert |
Post # 9
Quote:
Code:
knudfl@linux:~/tmp/2test-tar> tar xvf test-tar+bz2-1.17.tar.bz2 ..... |
Quote:
Isn't it easier to type "man tar" than navigate all those menus? Worst of all, I never, ever saw a Linux tutorial or instructions using info pages! I hardly ever heard of them! How was I supposed to know that info even exists? |
'man info'?? No, sorry, it's true. Official GNU programs frown on having man-pages since they have the 'wonderful' in-house tool called 'texinfo'. Don't get me wrong -I am no proponent of it -hate it in fact. And after 10 years using Linux, I... well I still have not been able to figure out how to use info to get any info! The trouble is that some programs have no man-pages at all, so you are stuck with on-line help or convertors. I am building a new system from scratch, and what I am gonna do is use one of the usable replacements, like pinfo or some info2html solution.
|
Why did they invent info when there already was man?
And still, I've NEVER heard of info before, except just once on some obscure web page I happened to get on accidentally. How is the average user even supposed to know about it? |
Quote:
At that point I noticed that I was reading in the 'G' part of this book for an item titled "Getting Started." Sometimes you just gotta know ... [lol] ~~~ 0;-Dan |
All times are GMT -5. The time now is 05:39 AM. |