Skip to content

Instantly share code, notes, and snippets.

@vyspiansky
Last active February 11, 2024 09:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vyspiansky/1cb63d52460b512c77c38a3573110d5f to your computer and use it in GitHub Desktop.
Save vyspiansky/1cb63d52460b512c77c38a3573110d5f to your computer and use it in GitHub Desktop.
Archive folder without redundant files using command line on macOS

Archive a folder without redundant files using the command line on macOS.

cd <folder_path>

where <folder_path> — a folder which should be archived.

zip -r <archive_name>.zip . -x "*.git*" -x "*.DS_Store"

or

zip -r <archive_name>.zip <folder_path>/* -x "*.git*" -x "*.DS_Store"

Check the archive content (files, folders inside)

unzip -l <archive_name>.zip

Reference: https://vyspiansky.github.io/2017/04/07/zip-archive-without-ds-store-macos/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment