Re: accessing files within .tgz folder

From: Jacob (Jacob_at_FAKEDOMAIN.NOTHERE)
Date: 09/27/05


Date: Tue, 27 Sep 2005 14:29:29 GMT

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]`