Extracting from a tar archive file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Extracting from a tar archive file
# 1  
Old 03-22-2008
Extracting from a tar archive file

Can I extract files from an archive file (tar), where the filename includes the full directory path, to a different directory?

For example the archive files may have a filename of
/SrcFiles/XXX/filename.dat
and I want to extract it to /SrcFiles/YYY/filename.dat. Since the archive file was created on another server, the /SrcFiles/YYY directory does not exist on the server I want to extract it to.

I understand I could create this directory temporarily on the target server, but there are reasons why I can not do that. Do I have any other options?
# 2  
Old 03-22-2008
There is no command line option for doing what you want to do if an absolute pathname was specified when creating the tarball.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. OS X (Apple)

Uncompressing but not extracting tar.Z file

Hi I have a few hundred files with extension .tar.Z. These files were archived (tar) and compressed (Z) on a UNIX system. I need to unzip them but not extract them. In other words they need to go to .tar extension. I would like to do this on my MAC or on a windows pc. I do not have a UNIX... (3 Replies)
Discussion started by: kalbano
3 Replies

2. Shell Programming and Scripting

Problem extracting zipped tar file

I was extracting the zipped tar file with the command gzip -dc Sample.tar.gz |tar xf - The tar file contained many delimited files; but lately they changed the structure of the tar file with another folder. So now all the delimited files are inside a folder called "Folder1" and the folder... (6 Replies)
Discussion started by: asandy1234
6 Replies

3. Homework & Coursework Questions

Creating and extracting archive file

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Hi there, I wish to create a single .tar file of the current directory but have literally no idea on where to... (8 Replies)
Discussion started by: Banned
8 Replies

4. UNIX for Advanced & Expert Users

Issue in extracting Tar and Zipped file.

Hi, I want to tar files and zip them in order to clean up space in directory. I have files like /path/file1 /path file2. What I am trying to do is: Option 1: tar -cvf /path/file1 /path file2 | gzip > test.tar.gz I got the file created. But while trying to extract the Tar and zipped file, I... (1 Reply)
Discussion started by: Quesemail
1 Replies

5. Shell Programming and Scripting

Extracting from archive | compressing to new archive

Hi there, I have one huge archive (it's a system image). I need sometime to create smaller archives with only one or two file from my big archive. So I'm looking for a command that extracts files from an archive and pipe them to another one. I tried the following : tar -xzOf oldarchive.tgz... (5 Replies)
Discussion started by: chebarbudo
5 Replies

6. Programming

read file from tar.gz archive

I want to write a c-program which reads a textfile from a tar.gz archive. How can I do it? (9 Replies)
Discussion started by: krylin
9 Replies

7. Solaris

option to delete .tar file while extracting

Is there an option in tar which deletes the .tar file as soon as it is successfully extracted. (5 Replies)
Discussion started by: vickylife
5 Replies

8. Shell Programming and Scripting

Read specific file from a zip archive without extracting

Hi All, I would like to extract specific file from a zip archive. I have a zip archive "sample.zip". sample.zip contains few text files and images... text1.txt, text2.txt, pic.jpg etc... I need to read specific file "text2.txt" from "sample.zip" WITHOUT EXTRACTING the zip file. ... (4 Replies)
Discussion started by: sridharg
4 Replies

9. UNIX Desktop Questions & Answers

Extracting from a tar file

Can I extract files from an archive file (tar), where the filename includes the full directory path, to a different directory? For example the archive files may have a filename of /SrcFiles/XXX/filename.dat and I want to extract it to /SrcFiles/YYY/filename.dat. Since the archive file... (1 Reply)
Discussion started by: nmalencia
1 Replies

10. UNIX for Dummies Questions & Answers

extracting from a tar file

Dear experts I have received a tar file containing several files with full path. Now I need to restore it in another system but when I want to extract files by using tar -xvf tarfile it wants to create all files with full paths again in new system in which I don't have enough previleges. How... (4 Replies)
Discussion started by: Reza Nazarian
4 Replies
Login or Register to Ask a Question