Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

My tar file contains many files but only the first file will extract

Status
Not open for further replies.

raypru

Technical User
Apr 9, 2002
26
0
0
GB
My tar file has many files but when I use tar xvf only the first file is extracted. What is the problem?

ray @ loninsathp1:/home/ray/scripts#ls -lrt use*
-rwxr--r-- 1 ray dba 271934 Jun 22 16:31 useful_scripts.tar


ray @ loninsathp1:/home/ray/scripts#tar -xvf useful_scripts.tar
x a.sql, 221 bytes, 1 tape blocks

tar tvf only displays one file although you can see from the size of the file in ls command the tar contains many files
 
The ls -lrt doesn't mean that you have many files inside the tar file! it just displays the size of the tar file not its content.

But i trust you if you say so.

Why don't you redirect the output to somewhere else?

tar -xvf useful_scripts.tar /tmp/test_dir

Regards,
Khalid
 
I take it tar -tvf (just to list the contents) gives the same result?

I want to be good, is that not enough?
 
There are probably 50 or 60 files in the tar. When I cat the tar file the contents of each file are displayed so the tar definitely contains all of the files. tar -tvf does the same and only shows the first file.
 
Does "pax -f useful_scripts.tar" give any different results?

I sounds like you've got either a corrupted file or one that was written in a buggy manner. Using a different implementation of tar (ie pax or even a PC with WinZip) might allow you to get around the problem.

- Rod


IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+

A Simple Code for Posting on the Web
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top