tar normal operation
September 19th, 2006 mysurface Posted in Uncategorized | Hits: 35851 | 7 Comments »
I am here to show you examples of how to use tar to zip and unzip two types of files ( tar.bz2, tar.gz)
Remember certain option defined, c for create, z for extract and t for test. v verbose, and f is file. There are 2 common archive people are interested in, bz2 and tar.gz (tgz). bz2 is more compress than tar.gz, but tar.gz is faster for creating and extracting.
To create a bz2 archive, if given list of files, use option j to indicate bz2
tar cjvf filename.tar.bz2 myfile1 myfile2 myfile3
To create a bz2 archive from a folder, if folder must be included in the archive, that means will be extracted with the folder
tar cjvf filename.tar.bz2 foldername/*
To create bz2 archive from a folder but the folder is not included in the tar file.
cd foldername; tar cjvf ../filename.tar.bz2
To test the tar file to see the content of the tar file, use t option.
tar tjvf filename.tar.bz2
To extract the tar file user x option.
tar xjvf filename.tar.bz2
For tar.gz, use back the same command option but change everything from j to z, let say to create the tar.gz file from folder.
tar czvf filename.tar.gz foldername/*
For more information, check with man







March 29th, 2007 at 5:09 pm
Thanks for solution from your solution i solved a big problem
April 3rd, 2007 at 1:37 am
Thanks, This the only post after 3 weeks of looking that explained exactly what the letters after tar denoted. thanks again.
April 7th, 2007 at 12:05 pm
[...] For more information or more advance options, check out tar normal operation. [...]
April 14th, 2007 at 5:54 am
[...] relational article : tar normal operation Here’s A Few More Related Posts [...]
January 10th, 2008 at 7:24 pm
Can neone tel me how to use
tar -a nd tar -r commands wid eg….plz
February 5th, 2010 at 7:43 pm
hellos,
I have a doubt if any can sowl
tar -jcvf sks.tar.bz2 *
OP? —% compressed is less than
bzip2 sks.tar
why??
if u not having solution mail me with subject code tar 23
i will provide best solution for ur que…
Shirish
shirish.linux@gmail.com
September 22nd, 2010 at 3:47 am
Thanks!
I was quick looking 4 tar + bzip2 compression parameters and Google look @ You.