List files in tarballs

find <path> -name "*.tgz" -or -name "*.tar.gz" | while read file; do echo "$file: "; tar -tzf $file; done
This script will list all the files in the tarballs present on any folder or subfolder of the provided path. The while loop is for echoing the file name of the tarball before listing the files, so the tarball can be identified

By: polaco
2009-11-10 20:39:04

1 Alternatives + Submit Alt

  • The magic is performed by the parameter -t Show Sample Output

    for F in $(find ./ -name "*.tgz") ; do tar -tvzf $F ; done
    alchandia · 2009-11-11 00:50:52 0

What Others Think

There is no need to use a while here... use find's -exec or xargs instead. find blah -exec tar -tzf {} \; find blah -print0|xargs -0 tar -tzf
din7 · 665 weeks and 1 day ago
the while loop is actually for echoing the file name The version you posted you cant identify in which tarball the file listed is
polaco · 665 weeks and 1 day ago
Command fixed. Didn't notice your echoing the file earlier. No while loop needed.
din7 · 665 weeks and 1 day ago
Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon. Big thanks for the useful info. slot pragmatic
KayGasaway · 40 weeks and 5 days ago
Thanks for sharing nice information with us. i like your post and all you share with us is uptodate and quite informative, i would like to bookmark the page so i can come here again to read you, as you have done a wonderful job. check bank routing number
KayGasaway · 40 weeks and 4 days ago
security and safety with care from staff 24 hours a day with professional supervision on online gambling gambling, legal gambling websites The best football betting website, quick deposit and withdrawal, many promotions, football betting, slots, lottery, baccarat, the number 1 online casino, must be 789Bet and 789Betting 123betting
KayGasaway · 40 weeks and 2 days ago
Amsoil Certified Dealer Beyond Performances is an Amsoil Dealer that provides the best Amsoil diesel oil, amsoil motor oil, best transmission fluid, and engine lubricants.
KayGasaway · 40 weeks and 2 days ago
Best Western Toilet in India | Western Toilet Price Buyers Guide, Western toilet or commode is an arrangement in the washroom to dispose of human wastes in a comfortable way These are also called flush toilets. Click here to visit website for more information.
KayGasaway · 39 weeks and 4 days ago
Explore KC Hemp Co ® is Kansas City's most trusted source, A best voted online cbd store ?for CBD Products Offering CBD gummies, CBD oil tinctures, CBD Pain Relief Lotion, and the best Delta 8 gummies in KC. Save 20% off of your first order just for joining! Visit our website Thank You.
KayGasaway · 38 weeks and 4 days ago
The 3E Accounting offer the best company incorporation services in Indonesia ?for your new company setup with full suite of incorporation services you can embark. Explore A Comprehensive Guide to All You Need to Know About Starting a Business
KayGasaway · 38 weeks and 3 days ago
Best ERISA nevada ?- Law Office of Julie Mersch,Our law firm specializes in all matters of ERISA Law, Personal Injury Law, and Insurance Law. Visit our website and find out how we can fight for you. Thank You.
KayGasaway · 38 weeks and 3 days ago
Enamel badge Enamel badges made to order, Badge Creation make all types of badges and lapel pins, enamel and printed. Call us on 0845 299 6550
KayGasaway · 38 weeks and 1 day ago
Pehr Silver is the best website for designer and handmade sterling silver jewelry for women and girls in India. Buy 92.5% sterling silver jewelry with free delivery.
KayGasaway · 37 weeks and 4 days ago
By US FDA regulations , you always need a FDA Prior Notice confirmation before the shipment enters the US to avoid abandonments, returns or delays.Now it is easy to get FDA Prior Notice Form & FDA Approval for less than $1, Buy 2 Get 1 Free . Automatic free credit topup to account . No code require . Click here to explore this offer. FDA Prior Notice
KayGasaway · 36 weeks and 2 days ago
Explore Event Rent & find the best Event Rentals & Party Services, Let’s uncover the Best Event Rentals ?near you. We connect you with local event services. Popular Exclusive Listings In Our Directory, Nearly 80% Of Consumers Turn To Directories With Reviews To Find A Local Business.
KayGasaway · 36 weeks and 2 days ago
This amazing posting usually have a good deal of travelers and tourists. Exactly how do you market it? It then provides for a perfect extraordinary rotate around actions. We incuring issue substantial along with sizable to gift home elevators is the main point. ?????? ????? ??? ????????
wenilak444 · 35 weeks and 1 day ago
Cool blog. Maybe i can help you in writing fresh content, are you interested ? ?????? ??????? ????? ??? ??? ??????
wenilak444 · 34 weeks and 3 days ago
I'm glad to see the great detail here!. Buy OxyContin 80mg Extended-Release Tablet
Coleman632 · 33 weeks and 3 days ago
thanks for the tips and information..i really appreciate it.. snow cone machine
Coleman632 · 33 weeks and 1 day ago
If more people that write articles really concerned themselves with writing great content like you, more readers would be interested in their writings. Thank you for caring about your content. slot auto wallet
Coleman632 · 33 weeks ago
Keep up the good work , I read few posts on this web site and I conceive that your blog is very interesting and has sets of fantastic information. ?????
Coleman632 · 32 weeks and 3 days ago
This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. slot55
Coleman632 · 30 weeks and 4 days ago
We have sell some products of different custom is very useful and very low price please visits this site thanks and please share this post with your friends.">empresa de web design
Coleman632 · 30 weeks and 3 days ago
I am typically to blogging i genuinely appreciate your content. The content has really peaks my interest. I am about to bookmark your web site and keep checking for brand new data. BabyLoungers
wenilak444 · 30 weeks and 3 days ago
Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!Thanks">bandarqq
Coleman632 · 30 weeks ago
Superior post, keep up with this exceptional work. It's nice to know that this topic is being also covered on this web site so cheers for taking the time to discuss this! Thanks again and again! ????? ??????????
Coleman632 · 29 weeks and 4 days ago
An affordable collection of Sterling Silver Earrings, Silver earrings for women, Moissanite Stud Earrings ?for women & Silver hoop earrings for Women. Inexpensive & Cheap Earrings for all Occasions.
KayGasaway · 28 weeks and 5 days ago
Thanks for the blog filled with so many information. Stopping by your blog helped me to get what I was looking for. Now my task has become as easy as ABC. [url=]Hemp Shop[/url]
Coleman632 · 28 weeks and 5 days ago
seofox · 26 weeks and 2 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: