[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Unattended decompression of multiple .tgz files to a single folder



Hello All, and thank you for your help some weeks ago regarding paging
menus in abcde (a better cd encoder).

I have a dvd-data disk. Written at its top level are 300 .tgz archives.
Therefore each archive has been firstly tar'd and then gzip'd. Each of
the 300 archives contains 2 folders ("Objects" and "Terrain") and each
of these 2 folders contain a number of sub-folders.

The tgz archives on the disk are named in this fashion:
e000n00.tgz e000n10.tgz e000n20.tgz ---etc----> e170s30.tgz--and so on.

I need to figure out the command line syntax to:

1. Extract *all* tgz files on the disk to a single directory,
say /home/hankthetank/flightgear/ so that the ./flightgear directory
contains the Objects and Terrain directories with the *combined*
contents of the Objects and Terrain directories in all the tgz archives
on the disk.
2. The same as above except be able to define a range of tgz archives to
extract, for example, e130s20.tgz, e130s30.tgz, e130s40.tgz, and
e140s20.tgz.

I have tried (from the command-line) file-roller, gunzip, and the man
pages for both, and I understand (I think) the use of the wildcard. But
I've had no luck, mainly because I can't get a command-line utility to
do the overwrite to the Object and Terrain directories from the
archives. Also gunzip wants to create a set of tar archives first. I
want to be able to go from tgz archives on the optical disk to 2
directories in my home directory in one hit, or on the fly (though I
guess the /tmp directory may need to be used).
I have not tried the | or grep options, because I don't (yet) understand
them, and I suspect the key lies somewhere there, since decompressing a
tgz is a two-stage process and the output of one process (untarring)
will need to be the input of another (un-gzipping). Am I right?

I don't care how complex the syntax is for this, as it would be a huge
time saver against a gui (obviously). 

If you are curious the tgz archives are in the format of map coordinates
for the outstanding flightgear program, and I got the archives from this
handy page http://www.flightgear.org/Downloads/scenery-0.9.10.html. When
you look at this page, you'll see why I would want to extract only a
range of archives (say, for a particular country only). Also you need to
consider that the tgz archives for the entire planet fill 3 dvd-data
disks, and extract out to about double that on a hard drive.

Any help or pointers are appreciated. And sorry about the length of the
post.

Thanks, Hank.



Reply to: