How to prevent macOS hidden files like ._* when creating .tgz archives?

Hi everyone,
I’m on macOS and every time I create a .tgz archive using tar, it includes annoying hidden files like ._filename, which are AppleDouble metadata files.

This causes issues when I try to train my model, when I try to access pictures table.

  1. How can I prevent these ._* files from being added in the archive in the first place?
  2. What’s the cleanest way to remove them before creating the .tgz?

Any best practices or reliable shell scripts you use would be super helpful.
Thanks a lot!

Hi @GuillotNico,
Welcome to the TensorFlow forum!
To prevent hidden ._* files out of your .tgz archives, set the COPYFILE_DISABLE=1 environment variable before running the tar command. And, To clean up use dot_clean , also you can remove existing ._* files by using find . -name "._*" -delete . Thank you!