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. | |
|
Comments (0)