The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help Required: Command to find IP address and command executed of a user loggedout Security 2 08-06-2008 09:12 PM
how to? launch command with string of command line options TinCanFury Shell Programming and Scripting 5 04-28-2008 07:06 PM
inconsistent ls command display at the command prompt & running as a cron job rajranibl SuSE 5 07-30-2007 09:26 AM
How to use more than one MPE command STREAM with Unix command in a single shell? bosskr HP-UX 1 10-16-2006 05:16 PM
How to use more than one MPE command STREAM with Unix command in a single shell? bosskr Shell Programming and Scripting 0 09-19-2006 10:44 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 10-19-2001
sof sof is offline
Registered User
  
 

Join Date: Oct 2001
Posts: 2
Tar Command

Suppose that you have to restore a file from a TAR and put it in a different directory.
To be more clear, suppose that you have a TAR file (backup of 3 files) :

tar -tvf TARfile
/data1/file1
/data2/data/file2
/data3/file3

You need to restore file2 to /tmp/file2.tmp ?
Is it possible ? if yes How ?

Thanks a lot in advance ...

Sof
  #2 (permalink)  
Old 10-19-2001
guest100's Avatar
guest100 guest100 is offline
Banned
  
 

Join Date: Oct 2001
Location: London, UK
Posts: 146
Take a look at the 'x' parameter below.

x Extract or restore. The named file s are extracted
from the tarfile and written to the directory
specified in the tarfile, relative to the current
directory. Use the relative path names of files
and directories to be extracted. If a named file
matches a directory whose contents has been writ-
ten to the tarfile, this directory is recursively
extracted. The owner, modification time, and mode
are restored (if possible); otherwise, to restore
owner, you must be the super-user. Character-
special and block-special devices (created by
mknod(1M)) can only be extracted by the super-
user. If no file argument is given, the entire
content of the tarfile is extracted. If the tar-
file contains several files with the same name,
each file is written to the appropriate directory,
overwriting the previous one. Filename substitu-
tion wildcards cannot be used for extracting files
from the archive; rather, use a command of the
form:

tar xvf... /dev/rmt/0 `tar tf... /dev/rmt/0 | grep 'pattern' `

When extracting tapes created with the r or u functions,
directory modification times may not be set correctly. These
same functions cannot be used with many tape drives due to
tape drive limitations such as the absence of backspace or
append capabilities.

Good luck
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:55 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0