Difference between revisions of "Tar"
From Linuxintro
imported>ThorstenStaerk (New page: tar is a command to pack files into an archive of the tar format. You can also use it to extract tar archive files. = pack an archive = To create an archive target.tar consisting of t...) |
imported>ThorstenStaerk |
||
Line 4: | Line 4: | ||
To create an archive target.tar consisting of the folder /home, use: | To create an archive target.tar consisting of the folder /home, use: | ||
tar cvf target.tar /home | tar cvf target.tar /home | ||
+ | |||
+ | = transmit a folder = | ||
+ | Thanks to the [[piping]] mechanism of Unix, you can also use tar to transmit a folder to another computer: | ||
+ | tar cf - <dir> | ssh <user>@<host> tar -xvf - -C <dir> | ||
= unpack an archive = | = unpack an archive = | ||
To unpack an archive file, use | To unpack an archive file, use | ||
tar xvf target.tar | tar xvf target.tar |
Revision as of 06:43, 16 May 2009
tar is a command to pack files into an archive of the tar format. You can also use it to extract tar archive files.
pack an archive
To create an archive target.tar consisting of the folder /home, use:
tar cvf target.tar /home
transmit a folder
Thanks to the piping mechanism of Unix, you can also use tar to transmit a folder to another computer:
tar cf - <dir> | ssh <user>@<host> tar -xvf - -C <dir>
unpack an archive
To unpack an archive file, use
tar xvf target.tar