In Linux, zip multiple directories in one named zip file

user3299633 picture user3299633 · Jul 10, 2015 · Viewed 76.9k times · Source

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.

Answer

Kiril Ivanov picture Kiril Ivanov · Jul 10, 2015

try

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

you can add more directories at the end of the command