Extract specific files in a tar archive using a wildcard

Posted by AdrieanKhisbe on Super User See other posts from Super User or by AdrieanKhisbe
Published on 2012-11-12T22:26:51Z Indexed on 2012/11/12 23:04 UTC
Read the original article Hit count: 292

Filed under:
|
|

I'm tring for a script to extract only jpeg pictures from an archive containing maky kind of files.

To do so I tried first to use:

   tar -xf MyTar.tar *.jpg

but it failed (*.jpg not found) and suggest me to use "--wildcard". So I tried

tar -xf MyTar.tar --wildcard *.jpg

I did that, but then the same error and a different warning saying yo me that the option "--wildcard" is ambigious.

I've been over the manuel pages for tar, but didn't find a clue about the problem

thanks

© Super User or respective owner

Related posts about linux

Related posts about unix