Backup and entire dir using tar?

Sean Miller sean at seanmiller.net
Thu Jan 20 07:39:38 UTC 2005


Senectus . wrote:

>On Wed, 19 Jan 2005 17:22:33 -0800, Bob Nielsen <nielsen at oz.net> wrote:
>  
>
>>On Wed, Jan 19, 2005 at 05:13:23PM -0800, Daniel Robitaille wrote:
>>    
>>
>>>On Thu, 20 Jan 2005 06:53:38 +0800, Senectus . <senectus at gmail.com> wrote:
>>>      
>>>
>>>>I want to tar up an entire directory and all the sub dir's in it as by
>>>>keeping all the permissions and structures as is..
>>>>I'm having a bugger of a time figuring out how it works.. whats the
>>>>best practice for tar.gz a dir with all sub dir for later restore..?
>>>>        
>>>>
>>>to create:
>>>  tar -cvf backup.tar   directory_to_backup
>>>
>>>to extract:
>>> tar -xvf backup.tar
>>>      
>>>
I've never known a "-" used...

tar cvfz x.tgz directory
tar xvfz x.tgz

also, tar tvfz x.tgz (to display contents).

Sean




More information about the ubuntu-users mailing list