How can I create a zip archive of a whole directory via terminal without hidden files?

Posted by moose on Ask Ubuntu See other posts from Ask Ubuntu or by moose
Published on 2011-08-27T18:01:33Z Indexed on 2012/11/01 5:17 UTC
Read the original article Hit count: 266

Filed under:
|

I have a project with lots of hidden folders / files in it. I want to create a zip-archive of it, but in the archive shouldn't be any hidden folders / files. If files in a hidden folder are not hidden, they should also not be included.

I know that I can create a zip archive of a directory like this:

zip -r zipfile.zip directory

I also know that I can exclude files with the -x option, so I thought this might work:

zip -r zipfile.zip directory -x .*

It didn't work. All hidden directories were still in the zip-file.

© Ask Ubuntu or respective owner

Related posts about command-line

Related posts about zip