5.14 Zip Files

20201231

To create a zip archive of, say, build/linux/x64/release/bundle, and not include the path to the directory, as we might want to do in building a distribution zip for a Flutter app, we can use:

(dest=$(pwd); cd build/linux/x64/release/bundle; zip -r ${dest}/app-dev-linux.zip .)

When sharing private and confidential documents with others it is often useful to create a zip archive that is encrypted. Whilst this is not a guarantee that the password or the encryption can not be compromised, it provides a level of casual protection if sending the documents by email. For stronger protection use strong encryption like Pretty Good Privacy.

zip --encrypt myarc.zip myarc/*.pdf

Do note that the zip archive will include the file names in clear text and thus it is best not to name the files that may indicate their contents.

unzip -l myarc.zip # List contents


Your donation will support ongoing availability and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984. Copyright © 1995-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0