First install zip if not already

sudo apt-get install zip

Now we can create zip by

zip -r compressed_filename.zip foldername

And to exclude directories while creating zip

sudo zip -r  test.zip * -x testdir/childdir/\* testdir/child2dir/\* testdir/child3.zip
Advertisements