Recursively Zip Up a Directory while Excluding Certain Files Based on File Extension Type

In the example below, I’m going to zip up a directory that includes images in both PNG and PSD file formats. However, I want to exclude the PSDs because they are huge!

zip -r my-compressed-dir-without-psd.zip directory-to-zip -x '*.psd'
26 Jun 2009, 11:22am
Linux:
by

leave a comment

Recursively Zip a Directory and Files on Linux

Short and sweet! Just remember that the finished zip filename is the first argument and the directory you wish to recursively zip comes after.

zip -r name_of_your_directory.zip name_of_your_directory