LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   need help with tar'ing and bz2'ing a file (https://www.linuxquestions.org/questions/linux-general-1/need-help-with-taring-and-bz2ing-a-file-329312/)

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

Hello!

Pack a directory to an tar archive:
Code:

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

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

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

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

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

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 06:50 AM.