Extract from tar without creating directory - Unix

This is a discussion on Extract from tar without creating directory - Unix ; 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 ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Extract from tar without creating directory

  1. Extract from tar without creating directory

    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


  2. Re: Extract from tar without creating directory

    Check the -O qualifier.

    Looks like you should be able to do this:

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


    wrote in message
    news:1131356755.697426.86690@g49g2000cwa.googlegro ups.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
    >




  3. Re: Extract from tar without creating directory

    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.

+ Reply to Thread