I want to zip a directory by excluding some unwanted subdirectories. I have tried :
zip -r test.zip * -x 'test1/' 'test2/'
and
zip -r test.zip * -x 'test1/' -x 'test2/'
But nothing happens.
I want to zip a directory by excluding some unwanted subdirectories. I have 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/\*
The \*
is an escaped wildcard character, which avoids path expansion by the shell prior to being passed to zip
.