[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Untarring multiple files

Posted on 2000-01-26
7
Medium Priority
?
681 Views
Last Modified: 2008-03-10
I downloaded the full folder of mini-howtos from the Linux Documentation project. One subfolder has all of the mini howtos in html format, but they are *.html.tar.gz. I can extract them individually with the command:
tar -zxvf filename.tar.gz with no problem but there well over a hundred mini howto's. I managed to ungzip all of them with an asterick so now all I have  are the hundred or so tarballs. I've been over the tar man pages and haven't found a promising way to extract them all at the same time.

BTW and unrelated - Mandrake 7 is simply amazing. It found my SBLive and set it up, my CD-Writer too, found my nic and asked me the right questions during install so that I was online at first boot.
0
Comment
Question by:dudleyf
7 Comments
 
LVL 2

Accepted Solution

by:
joe_h earned 600 total points
ID: 2390202
Assuming bash is your shell, type (in the right directory):
for i in *.tar.gz; do tar -zxvf $i; done
0
 
LVL 2

Expert Comment

by:joe_h
ID: 2390226
Actually, if you have already gunzipped them, all you need to do is
for i in *.tar; do tar -xvf $i; done
0
 
LVL 3

Expert Comment

by:freesource
ID: 2390257
. and since they have all been ungzipped you won't have to use the z in the above code joe_k gave you.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
LVL 2

Author Comment

by:dudleyf
ID: 2390653
That worked perfectly. I only had to type it 3 times to get it right.
Thanks!
Brian
0
 

Expert Comment

by:dpoper1
ID: 21481426
Hi, how would I be able to add to this if there are files that need have *.tar.gz along with .tar, and i would like to uncompress them at the same time.

I would appreciate your input.

regards,

Michael
0
 
LVL 2

Expert Comment

by:joe_h
ID: 21482209
You can combine the two mentioned commands (separated with semicolon):

for i in *.tar.gz; do tar -zxvf $i; done; for i in *.tar; do tar -xvf $i; done

The first part uncompresses and un-tars all .tar.gz files, the second part un-tars all the .tar files.
0
 

Expert Comment

by:dpoper1
ID: 21482398
Thank  you for your assistance,

regards,

michael
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
This article explains how to use the rsync command to create backups and sync data across hosts. Rsync is a very useful command that is often used to copy data, make backups, migrate hosts, and bridge the gap between site staging and production envi…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month8 days, 14 hours left to enroll

611 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question