Extracting file from tar at relative location!!


 
Thread Tools Search this Thread
Operating Systems Solaris Extracting file from tar at relative location!!
# 1  
Old 06-01-2009
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 have tried with “ tar –xvf *.tar ./subad/ “ and I am getting “tar: blocksize = 15 “

Please help
# 2  
Old 06-01-2009
why *.tar?

have you tried by giving <filename>.tar? Is it throwing same message?

can you paste complete command and error message.?

Regards
Abhi
# 3  
Old 06-01-2009
I am using the full file name with the absolute path where I need the extracts


Quote:
# tar -xvf cron.tar /mnt/sabad/
tar: blocksize = 15
# 4  
Old 06-01-2009
did you bring this tarball from some other server?
blocksize problem usually happens either because of diffrent platforms or tar version mismatch....
# 5  
Old 06-01-2009
You can use pax "-s" option which allows substituting path components on the fly. Gnu tar (gtar) might have a similar feature but is lacking a decent manual page for me to check.
# 6  
Old 06-01-2009
ak
no the tar is created on the same system.

jlliagre can you please suggest as what would be the real command. if the tar name is cron.tar and the location where the tar need to be extracted is /mnt/subad/

Thanks
# 7  
Old 06-01-2009
if you are talking about a restore of relative backup you must be in that directiory
ex mkdir /sun
cd /sun
tar -xvf /dev/rmt/0 .

Last edited by reborg; 06-01-2009 at 01:14 PM.. Reason: correct bad spelling, gammar and punctuation
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Convert Relative path to Absolute path, without changing directory to the file location.

Hello, I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies

2. 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

3. Shell Programming and Scripting

tar and relative paths

HOw can I create a tar file with relative paths find . -depth -print | xargs tar -cvf /tmp/file.tar ? Thanks to all who answer (1 Reply)
Discussion started by: BeefStu
1 Replies

4. UNIX for Dummies Questions & Answers

tar symlinks: relative vs absolute

I create the tar file from / like so: tar cEhf name.tar usr/us And this creates the tar with the links intact. The problem is that this tar is going to be used for testing, so we want the links to point to the files in the tar. But when I extract the tar into /tmp, I get /tmp/usr/us/... as I... (2 Replies)
Discussion started by: TreeMan
2 Replies

5. Shell Programming and Scripting

How to read the content of the particular file from tar.Z without extracting?

Hi All, I want to read the content of the particular file from tar.Z without extracting. aaa.tar.Z contains a file called one.txt, I want to read the content of the one.txt without extracting. Please help me to read the content of it. Regards, Kalai. (12 Replies)
Discussion started by: kalpeer
12 Replies

6. UNIX for Dummies Questions & Answers

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... (1 Reply)
Discussion started by: nmalencia
1 Replies

7. 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

8. UNIX for Dummies Questions & Answers

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 (5 Replies)
Discussion started by: malaymaru
5 Replies

9. 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

10. 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
Login or Register to Ask a Question