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