Take the 2-minute tour ×

How can I zip up the contents (excluding hidden files and folders) of the folder I am currently in?

zip -r extension.xpi . -x "*/.*"

This is what I have so far, but I am still getting hidden files.

share|improve this question
Do you mean hidden files in subfolders? Otherwise it's just * which by default does not include hidden files. –  frostschutz Feb 20 '13 at 0:49

1 Answer 1

up vote 2 down vote accepted

your */.* will only include hidden files in subdirectories. but not in your current directory or subdirectories of subdirectories. try this zip -r extension.xpi . -x ".*" or that zip -r extension.xpi . -x .\*.

I guess the backslash should be the key, thats a quote from the manpage:

Explicitly exclude the specified files, as in:

zip -r foo foo -x \*.o

which will include the contents of foo in foo.zip while excluding all the files that end in .o. The backslash avoids the shell filename substitution, so that the name matching is performed by zip at all directory levels.

share|improve this answer

Your Answer


