1836876 Members
1850 Online
110110 Solutions
New Discussion

Re: TAR TYPE FILE FORMAT

 
Deeos
Regular Advisor

TAR TYPE FILE FORMAT

Hi,

I having a file in my server
#file httpd.conf
file type: tar


how can i extract this file
Deepak
7 REPLIES 7
Aneesh Mohan
Honored Contributor

Re: TAR TYPE FILE FORMAT


Verify
=======

#tar -tvf httd.conf


Extract
======

#tar -xvf httd.conf


Aneesh
Deeos
Regular Advisor

Re: TAR TYPE FILE FORMAT

Aneesh

I used same syntex what you have written:
#tar -xvf httpd.conf /tmp/apache/


but it does not give any output in that location
Deepak
P Muralidhar Kini
Honored Contributor

Re: TAR TYPE FILE FORMAT

Hi Deeos,

>> but it does not give any output in that location
Is it a empty tar file ?

Post the output of the "#tar -tvf httd.conf" command.
Lets see how many files the tar file has.

Regards,
Murali
Let There Be Rock - AC/DC
Steven Schweda
Honored Contributor

Re: TAR TYPE FILE FORMAT

> I used same syntex what you have written:
> #tar -xvf httpd.conf /tmp/apache/

It's not the same syntax when you add things
to the command line. Especially when you
don't understand the command's syntax.

man tar

> but it does not give any output in that
> location

Perhaps because that's not how one specifies
a destination to "tar".

> #tar -tvf httd.conf

That was a pretty reasonable suggestion.
Perhaps you should try it.

"httpd.conf" is not a typical name for a
"tar" archive. Have you tried looking at the
file using something like a text editor?
Dennis Handly
Acclaimed Contributor

Re: TAR TYPE FILE FORMAT

>#tar -xvf httpd.conf /tmp/apache/

What were you attempting to do with this syntax?
This will extract the directory tree /tmp/apache/, if it is on the archive.
But I'm not sure what that trailing "/" will do to it?
Steven Schweda
Honored Contributor

Re: TAR TYPE FILE FORMAT

> [...] But I'm not sure what that trailing
> "/" will do to it?

Around here, with HP "tar", it seems to
defeat the usual functionality:

dyi # tar tfv ta.tar
rwxr-xr-x 0/3 0 Jun 6 05:47 2010 /tmp/apache/
rw-r--r-- 0/3 5 Jun 6 05:47 2010 /tmp/apache/fred

dyi # tar xfv ta.tar /tmp/apache
x /tmp/apache/fred, 5 bytes, 1 tape blocks
dyi # tar xfv ta.tar /tmp/apache/
dyi #

(Interestingly, there's no mention of
"restoring" "/tmp/apache" itself.)

GNU "tar" does better with the "/":

dyi # gtar xfvP ta.tar /tmp/apache
/tmp/apache/
/tmp/apache/fred
dyi # gtar xfvP ta.tar /tmp/apache/
/tmp/apache/
/tmp/apache/fred

(And it does mention the directory itself.)


dyi # uname -a
HP-UX dyi B.11.31 U ia64 4235313755 unlimited-user license

dyi # gtar --version
tar (GNU tar) 1.22
[...]


What's "-P"?
http://www.gnu.org/software/tar/manual/tar.html#SEC118
Steven Schweda
Honored Contributor

Re: TAR TYPE FILE FORMAT

Also interesting, possibly useful (to
someone):

dyi # pax -rv -f ta.tar /tmp/apache
USTAR format archive
/tmp/apache/
/tmp/apache/fred

dyi # pax -rv -f ta.tar /tmp/apache/
USTAR format archive
/tmp/apache/
dyi #