user580950 user580950 - 1 year ago 88
Bash Question

Exclude .Gz File while zipping - Debian Linux

zip -r foo/

I am using the above Linux command in
which compresses the folder ‘foo’ and all of its contents into a zip file called ‘’.

The command works great, I would like to exclude all files in all the subdirectories that have
file extension.

Is there a command to do it

pah pah
Answer Source

Use the --exclude (-x) option:

zip -r foo -x \*.gz
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download