user580950 user580950 - 6 months ago 36
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

Use the --exclude (-x) option:

zip -r foo -x \*.gz