Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

saving a directory

Status
Not open for further replies.

BIS

Technical User
Jun 1, 2001
1,893
NL
Hallo,
Is the s way to save a complete directory with all sub directorys and files? For example, I would like to zip (tar) up everything under /var/something - the complete somthing directory. What command do I use to pack it up, and what command do I later use to unpack it?
 
BIS:

To tar up:

tar cvf <yourfile>.tar /var/something

To untar:

tar xvf <yourfile>.tar (be careful re pathnames)

To read the tarfile without writing it:

tar tvf <yourfile>.tar

Regards.
 
Hi,

With many respects, I suggest to add a &quot;.&quot; before directory in tar command (cd /; tar cvf ~/<yourfile>.tar ./var/something), so that you can restore directory where you want
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top