Operating System - HP-UX
1754021 Members
7775 Online
108811 Solutions
New Discussion юеВ

use of tar to extract a file

 
SOLVED
Go to solution
Ron Bromwell
Frequent Advisor

use of tar to extract a file

I have an upgrade for my database in a tar file that I downloaded to the directory on my system. I can't seem to get the file extracted using tar with the x option. Any ideas on what I may be doing wrong?
life's a journey, not a destination
10 REPLIES 10
John Carr_2
Honored Contributor

Re: use of tar to extract a file


Hi

command would usually be when in directory of file

tar -xf ./myfilename
Nicolas Dumeige
Esteemed Contributor

Re: use of tar to extract a file

You can use file on the file to check that it's a normal tar archive ; i.e. not gzipped for instance ...

tar -tvf shall give you the list of file in the archive.

Cheers
All different, all Unix
Marvin Strong
Honored Contributor

Re: use of tar to extract a file

depending on how the tar was made.

tar xvf tarfile fullpath/file

should extract it for you.

if your not sure the path

tar tvf tarfile will show you.

Ron Bromwell
Frequent Advisor

Re: use of tar to extract a file

I keep getting a directory checksum error
life's a journey, not a destination
Shannon Petry
Honored Contributor

Re: use of tar to extract a file

This file may not be tar, but compressed tar. I have many times had Netscape or IE remove the second extension from "file.tar.gz", and rename it tar.

First, type

% file myfile.tar

If this is gzipped tar, it will tell you the file is awk program text. For compressed tar, it will tell you that it is 16 bit compressed. If it is tar, it will tell you it is tar.

Once you know what the file really is, it should be easy to fix. Simply rename the file accordingly.

It is always possible that the file is plain old corrupt. If this was an FTP binary file that came down in ASCII mode instead of binary, then the file is broken and you will need to re-download in the right mode.

Regards,
Shannon

Microsoft. When do you want a virus today?
Ron Bromwell
Frequent Advisor

Re: use of tar to extract a file

Shannon,
I got the following error when I issued
% file myfile.tar

cannot open for reading
life's a journey, not a destination
Robert-Jan Goossens
Honored Contributor
Solution

Re: use of tar to extract a file

Hi,

Did you use a ftp binary mode when you downloaded the upgrade file.

Robert-Jan
RAC_1
Honored Contributor

Re: use of tar to extract a file

Are the perms OK on file? Should have read access to you.

Anil
There is no substitute to HARDWORK
Ron Bromwell
Frequent Advisor

Re: use of tar to extract a file

It comes back as a tar file. must be something wrong withthe file I downloaded. I'll have to re-download it.
life's a journey, not a destination