Untar a TAR file at different location


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Untar a TAR file at different location
# 1  
Old 03-31-2006
Untar a TAR file at different location

Hi,

I want to UNTAR a TAR file at different location. Is it possible?
My TAR file contains the files with absolute path.

Malay
# 2  
Old 03-31-2006
untar

Quote:
Originally Posted by malaymaru
Hi,

I want to UNTAR a TAR file at different location. Is it possible?
My TAR file contains the files with absolute path.

Malay
Hi,

See This Thread.

Best Regards

Shoeb
# 3  
Old 03-31-2006
Hi ,
Try this

tar -xvf /the detsination/directory/youwant yourfile.tar
# 4  
Old 04-11-2006
Data

when i use

tar -xvf /destinationfolder sourceDirectory/myTar.tar

then it throws error:
tar: 0511-164 There is a media read or write block size error. Smilie

------------------------------------------------------
but pax is not installed.

so i have only possibility of using command: tar

i searched complete site and also most of the google.

still not found exact answer. Smilie

any idea?

Last edited by sunshine737; 04-11-2006 at 08:26 PM..
# 5  
Old 09-18-2006
Is there no solution to this problem?

Any help unix experts....

Priya
# 6  
Old 09-18-2006
Try this:
1. Run tar -tvf on the tarfile. This will tell you what is the absolute path in the tar file.
2. Make a soft link for that path to the actual path where you want to extract the files.
eg. Suppose that the path in the tar file is /home/common/xyz (files are present under the xyz directory) and you want to extract to /home/test directory, then simply do this:
a. mkdir -p /home/common
b. ln -s /home/test /home/common/xyz # assuming here that /home/test exists
3. Run tar to extract the files.
tar -xvf tarfilename # this will extract the files that were in the archive to /home/test
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to copy a tar file on a series of remote hosts and untar it on those hosts?

Am trying to copy a tar file onto a series of remote hosts and untar it at the destination. Need to do this without having to do multiple ssh. Actions to perform within a single ssh session via shell script - copy a file - untar at destination (remote host) OS : Linux RHEL6 (3 Replies)
Discussion started by: sankasu
3 Replies

2. Shell Programming and Scripting

scp/untar .tar file in parallel issue

Hi Guys, I am facing a strange issue while doing parallel (using & for background) scp/untar operation from my unix box to multiple unix boxes... I am getting tar : unexpected EOF in archive error the code is as follows.,,, for i in 10 do sh -c "scp <command> ; ssh tar -xf <tar> -C... (4 Replies)
Discussion started by: mihirvora16
4 Replies

3. Shell Programming and Scripting

untar .tar.gz file to a specific file

Hi, I'll get a tarred file from a remote location in the format of .tar.gz which my program needs to un-tar it into a specific destination foler and a file Incoming file/local/server/source/path/remote_file.txt.tar.gz Extracted file/local/server/destination/path/un-tar/stage_file.txt ... (5 Replies)
Discussion started by: dips_ag
5 Replies

4. UNIX for Dummies Questions & Answers

untar a tar file

how can I untar a file without extracting it? sample: file.tar to file thanks, lara (1 Reply)
Discussion started by: lhareigh890
1 Replies

5. Solaris

Extracting file from tar at relative location!!

Hi Gurus, I have a .tar file which required untar to the new location. I list the content with –tvf its listing the files which are inside the tar, when I am extracting he file from tar its working fine, however once I am trying to extract the file at the new location I am unable to do so. I... (11 Replies)
Discussion started by: kumarmani
11 Replies

6. Shell Programming and Scripting

Script to untar latest tar file

I am trying to put together a script that will check for the latest file in a directory then extract it. The extraction and the scheduling I can do, but am not sure how to get it to check for the latest file. These files are uploaded every evening by an external party and the previous days files... (3 Replies)
Discussion started by: stheologo
3 Replies

7. UNIX for Advanced & Expert Users

Tar utility (untar a .tar file) on VxWorks

Hi All Can someone pls guide me if there any utility to compress file on windows & uncompress on vxworks I tried as - - compressed some folders on windows ... i created .tar ( to maintain directory structure ) and compressed to .gz format. - on VxWorks i have uncompressed it to .tar... (1 Reply)
Discussion started by: uday_01
1 Replies

8. UNIX for Advanced & Expert Users

Untar to different location

Hi, I'm facing problem of untar'ing the tar contents with absolute pathnames to a different directory. Please provide me some hint on how to resolve it. Regards, Pradeep (1 Reply)
Discussion started by: pradeep_desh
1 Replies

9. Solaris

Restoring TAR'd file to different location

Is it possible to restore a TAR'ed file off of a tape to a location other than the original location? If so, how? (The MAN pages give examples of how to restore only to the originating location.) Thanks!! (1 Reply)
Discussion started by: FredSmith
1 Replies

10. UNIX for Advanced & Expert Users

Untar to different location

I have a tar file where the files have been tar'd along with the location of the file i.e /opt/abc/file.txt /opt/abc/file2.txt I am trying to untar this file on a different server where /opt/abc does not exist. How do I untar these files without the tar trying to create the structure... (3 Replies)
Discussion started by: handak9
3 Replies
Login or Register to Ask a Question