How To Compress A Tar Ball Directory In Linux
How To Compress A Tar Ball Directory In Linux Webune Forums
How, To, Compress, A, Tar, Ball, Directory, In, Linux


Fri Feb 29, 2008 12:01 pm - How To Compress A Tar Ball Directory In Linux
#784
How To Compress A Tar Ball Directory In Linux
author: web hosting
Leave Your Comments
name
comments
Share
Share this post by copy and paste this URL and put it on your forums or use it on your profile like myspace, friendster, Facebook, Twitter or others and add in with your comments.
URL Link: ask
Use this HTML code to embed this topic, just copy the code from the "Embed" box. Once you've copied the code, just paste it into your website or blog to embed it.
Embed: ask
BBCODE is use on forums. You can put this code on all your BBCODE enabled forums like PhpBB, vBulletin® and others. Just Copy and Paste this code on with Posts and Replies on your forums
BBCODE: ask
| More
Mon Jul 24, 2006 9:51 am - Re: How To Compress A Tar Ball Directory In Linux
#981
hostman
I you want to pack a whole directory along with its files and subdirectories, try running this command at the shell to see if it works, not sure if this is the correct command though:


     Code:
tar -cvf - directory_name | gzip -c > packed_directory_name.tar.gz
Mon Jul 24, 2006 9:55 am - Re: How To Compress A Tar Ball Directory In Linux
#982
hostman
Usage

* To pack tar files, use the following commands:
- for an uncompressed tar file:


     Code:
tar -cf packed_files.tar file_to_pack1 file_to_pack2


- to pack and compress (one step at a time):


     Code:
tar -cf packed_files.tar file_to_pack1 file_to_pack2 ...
gzip packed_files.tar


- to pack and compress all at once:


     Code:
tar -cf - file_to_pack1 file_to_pack2 ... | gzip -c > packed_files.tar.gz


- to create a tar from a directory and its subdirectories:


     Code:
tar -cvf packed_files.tar dir_to_pack


* To unpack tar files, use the following commands:
- for an uncompressed tar file:


     Code:
tar -xf file_to_unpack.tar


- to decompress and unpack one step at a time:


     Code:
gunzip packed_files.tar.gz
tar -xf packed_files.tar


- to decompress and unpack all at once:


     Code:
gunzip -c packed_files.tar.gz | tar -xf -


* To list the contents of a tar file, use the following command:


     Code:
tar -tvf file_to_list.tar


To use bzip2 instead of gzip, simply replace the commands above with bzip2 where gzip is used and bunzip2 where gunzip is used.