Add "
to the .*
(otherwise, your shell expands .*
to the dot files in the current directory), and also exclude hidden files in subdirectories:
zip -r zipfile.zip . -x ".*" -x "*/.*"
This will result in files starting with a .
not to be added into your zip file.
rinzwind@discworld:~/tmp$ ls -ladrwxr-xr-x 2 rinzwind rinzwind 4096 2011-08-28 00:15 tmpdrwxr-xr-x 2 rinzwind rinzwind 4096 2011-08-28 00:15 .tmprinzwind@discworld:~/tmp$ zip -r zipfile.zip . -x .*adding: .tmp/ (stored 0%)adding: tmp/ (stored 0%)rinzwind@discworld:~/tmp$ zip -r zipfile.zip . -x ".*" -x "*/.*"updating: tmp/ (stored 0%)