Extract from tar without creating directory
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix questions > Extract from tar without creating directory




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Extract from tar without creating directory  
colossus73@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-08-05 11:29 PM

Hi,

I'm developing a gtk frontend for various command line archiver, tar
included. My problem is to extract a filename from a tar archive
without creating the directory who contains the filename I want to
extract:

[gt@Paradise Xarchiver-0.3]$ tar tjvf
/Stuff/Xarchiver_Test/Asunder-0.1.0.tar.bz2 |head
drwxrwxrwx 1000/100          0 2005-01-27 20:23:52 Asunder-0.1.0/
drwxrwxrwx 1000/100          0 2005-01-27 20:23:52 Asunder-0.1.0/po/
-rw-r--r-- 1000/100        665 2005-01-27 16:16:28
Asunder-0.1.0/configure.in
-rw-r--r-- 1000/100      56156 2005-01-27 16:16:39
Asunder-0.1.0/aclocal.m4
-rw-r--r-- 1000/100        655 2005-01-27 16:34:38
Asunder-0.1.0/Makefile.am
-rw-r--r-- 1000/100      19366 2005-01-27 16:51:05
Asunder-0.1.0/Makefile.in
-rw-r--r-- 1000/100       1938 2005-01-27 16:32:06
Asunder-0.1.0/config.h.in
-rwxr-xr-x 1000/100     241280 2005-01-27 16:16:42
Asunder-0.1.0/configure
-rw-r--r-- 1000/100         58 2005-01-27 20:13:31
Asunder-0.1.0/ChangeLog
-rwxr-xr-x 1000/100      15205 2004-09-11 18:51:45
Asunder-0.1.0/depcomp

What is I want to extract depcomp only without creating the directory
Asunder-0.1.0 ??
I red the man page and googled but I haven't been able to do this.

Thanks
Colossus






[ Post a follow-up to this message ]



    Re: Extract from tar without creating directory  
Steve Foley


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-08-05 11:29 PM

Check the -O qualifier.

Looks like you should be able to do this:

tar -xvfO Asunder-0.1.0.tar '*depcomp*'>depcomp


<colossus73@gmail.com> wrote in message
news:1131356755.697426.86690@g49g2000cwa.googlegroups.com...
> Hi,
>
> I'm developing a gtk frontend for various command line archiver, tar
> included. My problem is to extract a filename from a tar archive
> without creating the directory who contains the filename I want to
> extract:
>
> [gt@Paradise Xarchiver-0.3]$ tar tjvf
> /Stuff/Xarchiver_Test/Asunder-0.1.0.tar.bz2 |head
> drwxrwxrwx 1000/100          0 2005-01-27 20:23:52 Asunder-0.1.0/
> drwxrwxrwx 1000/100          0 2005-01-27 20:23:52 Asunder-0.1.0/po/
> -rw-r--r-- 1000/100        665 2005-01-27 16:16:28
> Asunder-0.1.0/configure.in
> -rw-r--r-- 1000/100      56156 2005-01-27 16:16:39
> Asunder-0.1.0/aclocal.m4
> -rw-r--r-- 1000/100        655 2005-01-27 16:34:38
> Asunder-0.1.0/Makefile.am
> -rw-r--r-- 1000/100      19366 2005-01-27 16:51:05
> Asunder-0.1.0/Makefile.in
> -rw-r--r-- 1000/100       1938 2005-01-27 16:32:06
> Asunder-0.1.0/config.h.in
> -rwxr-xr-x 1000/100     241280 2005-01-27 16:16:42
> Asunder-0.1.0/configure
> -rw-r--r-- 1000/100         58 2005-01-27 20:13:31
> Asunder-0.1.0/ChangeLog
> -rwxr-xr-x 1000/100      15205 2004-09-11 18:51:45
> Asunder-0.1.0/depcomp
>
> What is I want to extract depcomp only without creating the directory
> Asunder-0.1.0 ??
> I red the man page and googled but I haven't been able to do this.
>
> Thanks
> Colossus
>







[ Post a follow-up to this message ]



    Re: Extract from tar without creating directory  
Sven Mascheck


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
11-10-05 01:48 AM

colossus73@gmail wrote:

> extract a filename from a tar archiv without creating the directory who
> contains the filename

Extract with "pax" which comes with a swith to "streamline-edit"
the paths before extracting.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 03:19 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register