-   Linux - General (
-   -   need help with tar'ing and bz2'ing a file (

surfbass 06-01-2005 04:46 PM

need help with tar'ing and bz2'ing a file
i read the man pages and i still cant figure it out...can somebody just got through the standard way to tar a directory and then bz2 (and .gz) it?

Andrew Benton 06-01-2005 04:54 PM

I don't know about the standard way, but what I do is cd into the folder above the one I want to compress and then use the command
tar cjf $FOLDER.tar.bz2 $FOLDER
replace $FOLDER with the actual name of the folder

surfbass 06-01-2005 04:57 PM

thanks...helped a lot

Boby 06-01-2005 04:58 PM


Pack a directory to an tar archive:

tar -cvf archive.tar directory
Pack now the the archive.tar to gz:

gzip archive.tar
You can merge this two steps and create a tar.gz archive of a directory with:

tar -cvf archive.tar directory && gzip archive.tar
Or a much faster and simply way:

tar cvfz archive.tar.gz directory
To pack a directory to a bz2 archive:

tar -cvjf archive.tar.bz2 directory
Good luck!

LinuxSeeker 06-01-2005 05:07 PM

EDIT: Sorry, I misread your message. If you have read the manual then try to play with simple, small text files to practice the additional options of tar and bzip2.

All times are GMT -5. The time now is 08:15 PM.