![]() ![]() Exclude Specific File Types from a Zip Archive Note: not all shells require the quotations for this command to work properly, but in the bash shell (the default for Mac OS X) you will need to use the quotes for excluding with wildcards and patterns. Zip -r archive.zip directory -x "*/\.DS_Store" If the directory includes subdirectories however, you’ll want to use another variation of that command to exclude the the ds_store files from subdirectories as well: Zip -r archivename.zip archivedirectory -x "*.DS_Store" DS_Store files from being included in a zip archive, which are bundled in by default: This will prevent the typically invisible Mac metadata. Let’s cover a few specific examples where this is useful. Zip archive.zip images/ -x "Nothanks.jpg" ![]() Meaning you could exclude a single file, say it’s named “Nothanks.jpg” ![]() At it’s most basic, it will look like this: The basics of file exclusion when creating a zip archive are centered around the -x flag, which is used to exclude files from the archive that match a specific name or pattern. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |