LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 06-01-2006, 09:33 AM   #1
David@330
Member
 
Registered: Jul 2004
Location: South Africa
Posts: 146

Rep: Reputation: 15
Cool restore a tar file.


Hi Again
Can some one help me, i forgot the command on how to restore a tar file.?
But the tar file is on my tape drive which is /dev/st0. the problem is i only want to restore certain file from the tar file into /restore directory and over write the files where came from on the system.?

Thanks
Dave
 
Old 06-01-2006, 10:26 AM   #2
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
See:
Code:
man tar 
or
tar --help
Try:
Code:
tar -tvf /dev/st0
to get a list of files on your device.
You may need to add some options if you want the tar archive is zipped (compressed).

Replace the "t" with an "x" and then add the files you want to extract at the end to restore your files.
You can use wildcards, but I suggest you put them inside single quotes, so that the shell doesn't do wildcard expansion before passing the parameters to tar.
ie
Code:
tar -xvf /dev/st0 '*.txt'
 
  


Reply


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 can i decompress this tar.tar file? hmmm sounds new.. tar.tar.. help ;) kublador Linux - Software 14 10-25-2016 03:48 AM
restore lfs from tar.bz2 file logicalfuzz Linux From Scratch 2 09-20-2005 02:13 AM
gave wrong syntax for tar as tar -cvzf file file.tgz how to recover the file gautham Linux - General 4 04-13-2005 04:15 AM
tar/restore questions solex Linux - General 5 09-01-2004 03:03 PM
how can I restore a tar backup len snelly Linux - Newbie 1 04-30-2002 01:29 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:12 AM.

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