I look help in tar xvf


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting I look help in tar xvf
# 1  
Old 10-05-2009
I look help in tar xvf

Dears,
I have copied one compressed file from one directory to another directory
say finame.txt.tar.gz copied from FirstDirectory to SecondDirecory

Code:
cd FirstDirectory  /
cp finame.txt.tar.gz  SecondDirecory
cd SecondDirecory/

once i do gunzip to finame.txt.tar.gz it, the file got decompressed into second directory

but when i execute tar xvf finame.txt.tar, the file got extracted in the FirstDirectory not in the SecondDirecory.

Please i look for help

thank you

Last edited by pludi; 10-05-2009 at 09:09 AM.. Reason: code tags
# 2  
Old 10-05-2009
How was the archive created? What's the output (first few lines) of 'tar tf finame.txt.tar'?
# 3  
Old 10-05-2009
the following is the code to create the archive
Code:
HDIR=/FirstDirectory

tar cvf /FirstDirectory/finame.txt.tar  /FirstDirectory/finame.txt
gzip /FirstDirectory/finame.txt.tar

the output (first few lines) of 'tar tf finame.txt.tar looks like

Code:
x /FirstDirectory/finame.txt, 1374709659 bytes, 2684980 tape blocks


Last edited by pludi; 10-05-2009 at 09:10 AM.. Reason: code tags
# 4  
Old 10-05-2009
Seems like the archive is automatically created using absolute path names. Check the man page for tar for any option to turn this off, or use this code instead:
Code:
cd /
tar cf FirstDirectory/finame.txt.tar FirstDirectory/finame.txt

# 5  
Old 10-05-2009
Dear,
could you help in turn off the option of using absolute path names. i searched but found nothing
the code in your mail didn't work

thank you
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

ZCAT xxx.Z|tar -xvf - decompression slow ?

I have recently built a new server and patched Soalris 10 up tp latest bundle etc... When I run a decompress using the format zcat fred.Z |tar -xvf - it runs at a very slow rate. A similiar server which is less powerful runs over twice as quick. Is there any work arounds to configure decompress... (4 Replies)
Discussion started by: smcart
4 Replies

2. UNIX for Advanced & Expert Users

Tar xvf in file

Good afternoom, I have a file very big, when I execute tar xvf XXXXXX_2010.tar, and show me this in the screen. x XXXXXX_2010_(01_DE_18).ixf, 3330845041 bytes, 6505557 media blocks. x XXXXXX_2010_(02_DE_18).ixf, 3336071703 bytes, 6515766 media blocks. x XXXXXX_2010_(03_DE_18).ixf, 3333011013... (3 Replies)
Discussion started by: systemoper
3 Replies

3. UNIX for Dummies Questions & Answers

Do I need to extract the entire tar file to confirm the tar folder is fine?

I would like to confirm my file.tar is been tar-ed correctly before I remove them. But I have very limited disc space to untar it. Can I just do the listing instead of actual extract it? Can I say confirm folder integrity if the listing is sucessful without problem? tar tvf file1.tar ... (1 Reply)
Discussion started by: vivien_chu
1 Replies

4. Shell Programming and Scripting

tar command to explore multiple layers of tar and tar.gz files

Hi all, I have a tar file and inside that tar file is a folder with additional tar.gz files. What I want to do is look inside the first tar file and then find the second tar file I'm looking for, look inside that tar.gz file to find a certain directory. I'm encountering issues by trying to... (1 Reply)
Discussion started by: bashnewbee
1 Replies

5. UNIX for Dummies Questions & Answers

tar xvf to a different directory?

Hi all, I have a tar file that was done with tar -cvf <tar_file> /directory. Is there any way that I can untar this, i.e. tar -xvf <tar_file> into a different directory? So far Google said you can't do tar -xvf to a different directory. Unfortunately, am not the one doing the tar -cvf... (9 Replies)
Discussion started by: newbie_01
9 Replies

6. UNIX for Dummies Questions & Answers

tar -cvf test.tar `find . -mtime -1 -type f` only tar 1 file

Hi all, 4 files are returned when i issue 'find . -mtime -1 -type f -ls'. ./ora_475244.aud ./ora_671958.aud ./ora_934052.aud ./ora_934050.aud However, when I issued the below command: tar -cvf test.tar `find . -mtime -1 -type f`, the tar file only contains the 1st file -... (2 Replies)
Discussion started by: ahSher
2 Replies

7. AIX

tar -xvf doesnt work

Hello Im trying to extract this file tar -xvf opt-samba-base.tar.tar tar: 0511-169 A directory checksum error on media; 0 not equal to 75420. but I get that message I tried algo with gunzip and uncompress but nothing happens gunzip -d opt-samba-base.tar.tar gunzip:... (2 Replies)
Discussion started by: lo-lp-kl
2 Replies

8. Solaris

tar -xvf is showing error

Hi, When i am trying to untar a file for installation its showing an error like tar -xvf te_agent__sparc.en_tar.gz tar: directory checksum error Please help me to solve this issue........... (10 Replies)
Discussion started by: Renjesh
10 Replies

9. UNIX for Advanced & Expert Users

'tar -xvf' command filled up /dev/root

On a newly configured hp unix server, I got the following error while I was trying to untar a file: tar -xvf 9201rdbms.tar .... /htc_ora_prod/stage9.2.0_64bit/Disk2/stage/Components/oracle.rdbms.seeddb.compoltp/9.2.0.1.0/1/DataFiles/Expanded/seed/templates/Transaction_Processing.dfj, 174282115... (2 Replies)
Discussion started by: YuChing
2 Replies
Login or Register to Ask a Question