Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-19-2010, 04:55 PM   #1
Registered: May 2010
Location: UK
Distribution: OpenSuse 64 bit
Posts: 45

Rep: Reputation: 15
Smile restore tar.gz file to different location

Hi all,

I created a tar file in the following location:


file name scriptsbkp.tar.gz

command used to create tar file:
tar -czvPf /home/denis/backups/scriptsbkp.tar.gz /home/denis/scripts

I want to extract tar.gz into following folder:

but I receive following error:

tar: Error is not recoverable: exiting now

tar: Child returned status 2

tar: /home/denis/restored: Not found in archive

tar: Exiting with failure status due to previous errors

I used this command to restore:
tar -zxvf scriptsbkp.tar.gz /home/denis/restored

I can restore tar file in the /home/denis/scripts.

Can someone advise how do I restore tar.gz file to different location please? I was logged on as root while creating and restoring file.

Thanks in advance

Old 07-19-2010, 05:34 PM   #2
Registered: Nov 2009
Posts: 66

Rep: Reputation: 19
you don't need to be root to tar stuff in your home dirs. Only if you wanted the tarfile to go into another dir where the "home user" doesn't have permissions.


tar -C /home/denis/restored -xzvf scriptsbkp.tar.gz

or put the -C /home/denis/restored at least 1 space away to right of your tarfile
Old 07-25-2010, 11:56 AM   #3
Registered: May 2010
Location: UK
Distribution: OpenSuse 64 bit
Posts: 45

Original Poster
Rep: Reputation: 15
That worked well,




Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to restore a tar file and exclude a directory j-me Linux - General 3 01-26-2010 01:24 PM
BackUp & Restore with TAR (.tar / .tar.gz / .tar.bz2 / tar.Z) asgarcymed Linux - General 5 12-31-2006 03:53 AM
Restore a single file from tar archive lucktsm Linux - General 2 12-03-2006 02:57 PM
restore a tar file. David@330 Linux - Newbie 1 06-01-2006 10:26 AM
restore lfs from tar.bz2 file logicalfuzz Linux From Scratch 2 09-20-2005 02:13 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:02 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration