Article 592N6 Need help writing a script that will unzip and then untar files from a series of directories

Need help writing a script that will unzip and then untar files from a series of directories

by
kaplan71
from LinuxQuestions.org on (#592N6)
Hello --

We have a large number of tgz files that are to be unzipped, and then untarred for general use. To complicate matters, each of these files is in its own directory as shown below:

Quote:
ll 001 && ll 000001 && ll 000012
total 25040
-rw-r--r--. 1 root root 25640121 Oct 30 2017 000_matroxx_Sep_17_2010.tgz
total 7220
-rw-r--r--. 1 root root 7391131 Oct 30 2017 000000_TEST2BED_Aug_21_2010.tgz
total 4
-rw-r--r--. 1 root root 333 Oct 30 2017 000011_Configuration__EPIX_Oct_01_2010.tgz
A for loop script should work here, but I need help in crafting it to do the following:

1. Go into each directory to do the gunzip and subsequent tar extract.
2. The extracted folders from each directory should all be sent to another folder.latest?d=yIl2AUoC8zA latest?i=6AO-vfC69nY:tSh6TXPe9lc:F7zBnMy latest?i=6AO-vfC69nY:tSh6TXPe9lc:V_sGLiP latest?d=qj6IDK7rITs latest?i=6AO-vfC69nY:tSh6TXPe9lc:gIN9vFw6AO-vfC69nY
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments