Whenever you have to zip and share files, you probably don’t want to include the .DS_Store
file and __MACOSX
folder in the zip file.
The .DS_Store
(Desktop Service Store) is a hidden file containing attributes of its enclosing folder, such as the icon size display. The __MACOSX
folder is created during the zip process and contains metadata about the compressed files.
The zip
command has a -x
parameter that excludes a file or folder of a certain pattern from the resulting zip file. Additionally, the -x
parameter can be declared multiple times in order to accomplish multiple exclusions.
For instance, to exclude both .DS_Store
file and __MACOSX
folder, simply run:
zip -r my_compressed_file.zip path/to/folder -x "*.DS_Store" -x "__MACOSX"
to compress all the contents of path/to/folder
directory to the my_compressed_file.zip
file.
Hope it helps. Cya!
This guide will show you how to create a Python function decorator with a few…
This guide will show you how to fix the error Got permission denied while trying…
This guide will show you how to create a Python virtual environment on Intellij IDEA…
This tutorial will quickly show you how to to find and kill processes on Linux,…
This guide shows a possible solution for Python error Relocation R_X86_64_PC32 against symbol can not…
I condensed below a cheat sheet of Kubernetes useful commands. I will keep updating this…
View Comments
Always need this! Thank you!