Knowledgebase: Miva Empresa VM
How-To: UNIX tar command
Posted by - NA - on 08 February 2007 09:46 PM
Title
---------
How-To: UNIX tar command

Solution
-----------
Create:
tar -cvf mystuff.tar mystuff/
tar -czvf mystuff.tgz mystuff/

Extracting:
tar -xvf mystuff.tar
tar -xzvf mystuff.tgz

Testing/Viewing:
tar -tvf mystuff.tar
tar -tzvf mystuff.tgz

Note that .tgz is the same thing as .tar.gz

Tar "tars up" a bunch of files into one "tar-file"gzip is compression,
but only works on one file, so the entire "tarfile" is compressed.

Also when creating a tar or cpio backup, never, never, never use an
"absolute" path -- you have been warned; also linux tar warns you of
this too. The problem is that when you want to unpack, you cannot choose
where to unpack to, you will be forced to unpack to the "same" absolute path.
When creating a tar or cpio you should change the the appropriate directory
and tar from there.

Also when creating a tar or cpio it is general good practice to tar up a directory
(appropriately named) which contains your files, rather than just the files. This is
good courtesy to anyone unpacking your tarfile.
(688 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
CAPTCHA Verification 
 
Please enter the text you see in the image into the textbox below. This is required to prevent automated registrations and form submissions.

Help Desk Software by Kayako support.miva.com/supportsuite/index.php?