Zip including hidden files

Fzs2 picture Fzs2 · Sep 19, 2012 · Viewed 82k times · Source

In Linux I can zip all(except hidden files) in current directory by doing:

zip 1.zip *

But how do I include the hidden files?

Answer

Gunnar picture Gunnar · Sep 19, 2012

EDIT: The correct way is zip -r 1.zip .

The commands shown in my previous answer below are incorrect because they also include the parent directory.


Have you tried this:

zip yourfile.zip sourcedir/* .*

or you in your case

zip 1.zip * .[^.]*'

It should include all hidden files also.