Make .zip archive and exclude some subdirectories

Go to parent directory and use:


zip -r dir1.zip dir1 -x dir1/ignoredir1\* dir1/ignoredir2\*

Where:

  • dir1.zip – the name of the archive that will be created
  • dir1 – the name of the folder that you want to archive
  • ignoredir1, ignoredir2 – the names of the folders that you want to exclude from the archive