Untar with wild cards

19/06/08

Permalink 03:55:14 pm, by Kieren Email , 106 words, 96 views English (GB)
Categories: Computing, Linux

Untar with wild cards

tar doesn’t seem to like using wild cards. If you are trying to decompress multiple files in one go you might try a command like:

kieren@home:~/archives> tar -xf *.tar

However, this produces multiple errors, one for each file that the wild card matches:

tar: archive1.tar: Not found in archive
tar: archive2.tar: Not found in archive
tar: archive3.tar: Not found in archive
tar: archive4.tar: Not found in archive
tar: archive5.tar: Not found in archive

A quick solution is to use a loop to decompress them one at a time like so:

for archive in *.tar ; do tar -xf archive ; done

Trackback address for this post:

This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

Comments, Trackbacks, Pingbacks:

No Comments/Trackbacks/Pingbacks for this post yet...

Leave a comment:

Your email address will not be displayed on this site.
Your URL will be displayed.

Allowed XHTML tags: <p, ul, ol, li, dl, dt, dd, address, blockquote, ins, del, span, bdo, br, em, strong, dfn, code, samp, kdb, var, cite, abbr, acronym, q, sub, sup, tt, i, b, big, small>
(Line breaks become <br />)
(Set cookies for name, email and url)
(Allow users to contact you through a message form (your email will NOT be displayed.))
This is a captcha-picture. It is used to prevent mass-access by robots.
Please enter the characters from the image above. (case insensitive)

November 2008
Mon Tue Wed Thu Fri Sat Sun
 << <   > >>
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30

Search

Categories

KBlog

XML Feeds

What is RSS?

Misc

b2evolution