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.

Example,

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

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

Example,

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

 

Leave a Reply

Your email address will not be published. Required fields are marked *