trick commands of macos.
find
clear all “.DS_Store” files within a folder and its subfolders recursively
find /path/to/folder -name ".DS_Store" -type f -delete
tar
To prevent the creation of these “._cached-data” files when compressing files on macOS, you can use the –disable-copyfile option with the tar command. Here’s an example:
tar --disable-copyfile -czf archive.tar.gz files-to-compress
Alternatively, if you’re using a recent version of tar
(version 1.32 or higher), you can use the --exclude='._*'
option to exclude all files starting with “._” from the archive. Here’s an example:
tar -czf archive.tar.gz --exclude='._*' files-to-compress