Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.