ziphidden-files

Zip including hidden files


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?


Solution

  • 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.