accessing files within .tgz folder - Redhat

This is a discussion on accessing files within .tgz folder - Redhat ; Howdy folks, I am newbie and am trying to figure out a way to search for a set of files that are compressed within some .tgz folders and copy these specified files into a new directory. Iam using RH enterprise. ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: accessing files within .tgz folder

  1. accessing files within .tgz folder

    Howdy folks, I am newbie and am trying to figure out a way to search
    for a set of files that are compressed within some .tgz folders and
    copy these specified files into a new directory. Iam using RH
    enterprise. I was looking around at different bash scripts. I didn't
    know if it was possible to access files and copy them without having to
    uncompress the folders. Is it possible?
    Any help or suggestions people have is muchly aprreciated
    thanks

    -Rich


  2. Re: accessing files within .tgz folder

    On 27 Sep 2005 07:03:37 -0700, a posting issued forth from Rich...
    > Howdy folks, I am newbie and am trying to figure out a way to search
    > for a set of files that are compressed within some .tgz folders and
    > copy these specified files into a new directory. Iam using RH
    > enterprise. I was looking around at different bash scripts. I didn't
    > know if it was possible to access files and copy them without having to
    > uncompress the folders. Is it possible?


    No. In order to know anything about them, they must be uncompressed. But
    you don't have to uncompress them them to disk, memory is sufficient:

    # List files:
    $ tar ztvf backup.tgz
    # Find my.file
    $ tar ztvf backup.tgz | grep my.file
    # Extract directory/mine/my.file
    $ tar zxvf backup.tgz directory/mine/my.file

    HTH

    --
    Jacob
    mailto:`echo wnpbo@urvqre.ubzryvahk.arg | tr [a-z] [n-za-m]`

+ Reply to Thread