Stuck in TAR
David Bruzos
david at bruzos.org
Sun Jan 2 23:36:48 EST 2005
Hello Nick:
I can help you with this one, but I do not understand your question.
Are your files in the .rar format or in some other format. Are they
.tar.gz or .tar.bz2?
If your files are in rar archive format, you will not be able to extract
them using tar. You will have to use the rar program to extract them.
However, if your files are in tar.bz2 format or .tar.gz you can do:
To extract:
# tar -xjf file.tar.bz2
or:
# tar -xzf file.tar.gz
To compress to .bz2 or gz do:
# tar -cjf output-file.tar.bz2 directory1 directory2 ...
or:
# tar -czf output-file.tar.gz dir1 dir2 ...
If you just want to incapsulate a directory tree in tar, just do:
# tar -cf file.tar directory/
Note: This last command will not compress the files, it will just
archive them.
You can also compress files directly (without tar) by doing:
# bzip2 file-name
Note: This will not encapsulate the files, it will just compress them
individually.
A note about bzip2 and gz: Bz2 has the best compression ratio out of
the two, but it takes much longer than gz to compress. Bz2 is specially
good for binary files and other such formats. Rar is good too, but it
is extremely slow, closed source, and generally not justified to be
used. Bz2 still compresses much faster than rar though.
Hope this helps!
David Bruzos
On Sun, Jan 02, 2005 at 09:19:45PM -0600, W. Nick Dotson wrote:
> Read the "man tar" and message Janina sent me with examples. Did,
> "tar //media/cdrom/*.*"
> Was informed that it couldn't find the "tar" file in first file, furthermore, that the file was using "obsolescent base-64 headers" which I always thought had to do
> with mime encoding, and subsequently told me it couldn't find the "tar" files ineach of the other files. Thing is, these same files yielded their contents as "html"
> files using "rar" on my Windows machine, but I'd really rather them be in "/usr/lib" where alot of ".doc" files seem to live in sub-directories having used the
> "locate" command as learned from other postings, to see where document files lived on the system... Figured if "tar could extract, the files would be plopped in
> "/usr/lib" where I was sitting when I ran the command.
>
> Nick (the rather stuck rabbit)
>
>
>
>
> _______________________________________________
> Speakup mailing list
> Speakup at braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup
More information about the Speakup
mailing list