I'm trying to compress only two files in a directory. Let's say I have a directory named 'images'. In the directory, I have a.jpg, b.jpg, c.jpg, and d.jpg. I like to compress only a.jpg and b.jpg using tar.

I googled about it, but weirdly I could not find it!

link|improve this question

66% accept rate
2  
found out: tar cvfz file.tar.gz a.jpg b.jpg – user12077 Jun 20 '11 at 8:38
feedback

1 Answer

up vote 3 down vote accepted

Maybe:

tar cvf output.tar images/{a,b}.jpg

?

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.