How to create zip archive excluding some files and folders

ZIP is an archive file format that supports lossless data compression. A ZIP file may contain one or more files or directories that may have been compressed.

For excluding files of folder, we can use '--exclude' option.


#zip -r --exclude=cache --exclude=test.php public_html

Please note that we can use wild chars in the exclude options.


#zip -r --exclude=cache --exclude=test* --exclude=*old* public_html


Leave a Reply