|Home||Reviews||Tools||Forums||FAQs||Find Service||ISP News||Maps||About|
how-to block ads
tar(manual page)is a very handle little program to store files and folders in archives, originally made for tapestreamer backups.Tar is usually used together with gzip (manual page) or bzip2(manual page), compression programs that make your .tar archive a much smaller .tar.gz or.tar.bz2 archive.
You can use the program ark K -> Utilities -> Ark to handle archives in KDE.
Konqueror treats file archives like normal folders, simply click on the archive to open it. The archive becomes a virtual folder that can be used to open, add or remove files just as if you were working with a normal folder.
tar files (.tar.gz)
To untar files:
tar xvzf file.tar.gz
To tar files:
tar cvzf file.tar.gz filedir1 filedir2 filedir2...
Note: A .tgz file is the same as a .tar.gz file. Both are also often referred to as tarballs.
z is for gzip,
v is for verbose,
c is for create,
x is for extract,
f is for file
(default is to use a tape device).
bzip2 files (.tar.bz2)
To unpack files:
tar xjvf file.tar.bz2
To pack files:
tar cvjf file.tar.bz2 filedir1 filedir2 filedir2...
Same as above, but with
j for for bzip2
You can also use bunzip2 file.tar.bz2 , will turn it into a tar.
For older versions of tar, try tar -xjvf or -xYvf or -xkvf to unpack.There's a few other options it could be,
they couldn't decide which switch to use for bzip2 for a while.
How to untar an entire directory full or archives?
for i in `ls *.tar`; do tar xvf $i; done
for i in `ls *.tar.gz`; do tar xvfz $i; done
for i in `ls *.tar.bz2`; do tar xvfj $i; done