Copying Jar files into single zip file

0

I am trying to compress the hundreds of jar files into a single zip file that can be transferred to a different location. Please help.

Prit

Posted 2014-02-24T20:09:41.583

Reputation: 1

Answers

1

Jar files are very similar to zip archives therefore combining them into one archive will not save a lot of space. However if you really want to make one zip archive then one of the simplest solution would be to execute for loop on all jar files:

for f in *.jar; do
 zip archive.zip "$f"
done

If you want to use gzip, then:

tar -czvf archive.tar.gz *.jar

Wojtek

Posted 2014-02-24T20:09:41.583

Reputation: 11