If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > How to un tar a specific file with the same name but diff date?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-23-04, 14:57
hailieu hailieu is offline
Registered User
 
Join Date: Sep 2002
Posts: 24
Lightbulb How to un tar a specific file with the same name but diff date?

I have a big tar file name biggy.tar with 10000 files in it and there are 5 files with the same name as trick.txt with different date stamp on them.

like:

... 434 May 3 16:55 2003 /ttt/reter/trick.txt
... 434 May 3 16:57 2003 /ttt/reter/trick.txt
... 434 Jan 1 12:44 2004 /ttt/reter/trick.txt



How do I untar the trick.txt with the date May 3 16:57 ??
Reply With Quote
  #2 (permalink)  
Old 03-24-04, 02:20
aigles aigles is offline
Registered User
 
Join Date: Jan 2004
Location: Bordeaux, France
Posts: 319
There is no option to select a specific version of a file in an archive for extraction.
When you extract the file, you got at final the last version of the file in the archive.

Extract from man page :
Quote:
-x Extracts the files specified by one or more File parameters from the archive.
If the File parameter refers to a directory, the tar command recursively
extracts that directory from the archive. If you do not specify the File
parameter, the tar command extracts all of the files from the archive. When an
archive contains multiple copies of the same file, the last copy extracted
overwrites all previously extracted copies.
If the file being extracted does not
already exist on the system, the file is created. If you have the proper
permissions, the tar command restores all files and directories with the same
owner and group IDs as they have on the tape. If you do not have the proper
permissions, the files and directories are restored with your owner and group
IDs. It is not possible to ask for any occurrence of a file other than the last.
__________________
Jean-Pierre.
Reply With Quote
  #3 (permalink)  
Old 03-24-04, 13:26
hailieu hailieu is offline
Registered User
 
Join Date: Sep 2002
Posts: 24
Lightbulb

It got to have a trick we can do this. I saw it somewhere but did not border to write it down or memorize it.

does any one know to work around this?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On