In Linux, zip multiple directories in one named zip file

LinuxZip

Linux Problem Overview


I have the following directories, I want to zip up into the same zip file. Can someone provide the correct syntax?

ie. zipping the following directories:

  • /home/users/jlefler/files
  • /opt/software/reports/files

into a zip file called backup.zip.

Linux Solutions


Solution 1 - Linux

try

zip -r backup.zip /home/users/jlefler/files /opt/software/reports/files

you can add more directories at the end of the command

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser3299633View Question on Stackoverflow
Solution 1 - LinuxKiril IvanovView Answer on Stackoverflow