I want to archive the directory, excluding some unwanted subdirectories. I tried:
zip -r test.zip * -x 'test1/' 'test2/'
and
zip -r test.zip * -x 'test1/' -x 'test2/'
But nothing happens.
Try
zip -r test.zip * -x test1/\* test2/\*
\*is an escaped wildcard character that avoids the shell extending the path before passing in zip.
\*
zip