erikvold
erikvold

Reputation: 16508

How to move a file in to zip uncompressed, with zip cmd tool

I'm try to determine how to use the zip cmd line tool to move a file (uncompressed) in to a zip of compressed files (ie I want a zip in the end with all files but one compressed, b/c the one file is another compressed file).

Anyone know how to do this?

Upvotes: 3

Views: 5747

Answers (2)

erikvold
erikvold

Reputation: 16508

-m is what I wanted, moves the file(s) into a zip.

Upvotes: 1

skajfes
skajfes

Reputation: 8255

It looks like you could use -n option to just store the files with defined extensions together with -g option to append the file to archive.

I didn't test it, but something like this should do the trick:

zip -gn .foo archive.zip myAddedFile.foo

Although documentation states that, by default, zip does not compress files with extensions in the list .Z:.zip:.zoo:.arc:.lzh:.arj, so if you are adding a file with one of those extensions you should be fine.

Documentation to the command is here

Upvotes: 2

Related Questions