I normally use gzip for file compression. However, there is time when you want to share a compressed file with Windows users and you want to avoid them cursing at you. One good solution is to use zip compression (even if I had to learn how to do it on a Linux machine).

Well, like always we can run man zip to learn more about it, but since you’re reading this, it is unlikely that you’re doing that. So, here is how you can do it.

  1. Ensure that zip package is installed. On Fedora and Ubuntu, the package naem for zip utility is called zip.
# rpm -q zip
zip-3.0-36.fc38.x86_64
  1. The command to zip a folder name, named FOLDER, to create a file called myzipfile.zip is:
zip -r myzipfile.zip FOLDER 

That’s it.

Reference: