Keeping some files uncompressed while using zip

Viewed 242

I am trying to create a zip file using the following command.

zip -r somefolder.apk . -n *.mp4*

The idea is to compress all the elements in the directory while keeping the files having .mp4 extension as they are (not compressed) and included in the zip folder. How can I do that?

When I run this command, the zip file is created successfully, however, the .mp4 files are compressed as I can see them by running unzip -lv somefolder.apk

Defl:N   202016  46% 12-30-1979 19:00 89b64dcb  res/raw/some_animation.mp4

As far as I know the Defl:N indicates that the file has been compressed.

Thanks in advance!

1 Answers

Oh, my colleagues helped me to find that out! Posting it here as an answer hoping other developers may find it useful!

We do not have to add the * here. The following command should work just fine!

zip -r somefolder.apk . -n .mp4:.zip:.gzip
Related