A lot of "._" files inside a tar

The ._ files are how OS X bsdtar handles OS X-specific extended attributes and resource forks. (It's a mechanism known as AppleDouble, and it in fact applies to more than just TAR archives, being found in several storage formats where there is no native mechanism for holding MacOS resource forks and Finder information.)

To keep them from being added to your tar files, you can pass COPYFILE_DISABLE=1 as an environment variable to tar.

COPYFILE_DISABLE=1 tar cf newTar.tar /your/files


To my understanding, tar --exclude='._*' -cvf newTar . should work: Finder creates the ._* files but newTar shouldn't contain them.

But you can completely bypass those files by invoking tar in passthrough mode. For example, to copy only the files from oldTar that are under some/path, use

tar -cf newTar --include='some/path/*' @oldTar

Those files starting with "._*" are apple specific location indicator files according to THIS POST and you obviously can not get rid of them while logged in to your terminal om OSX, again according to the same page. You need to upload the file to a non-apple OS, get rid of those files and tar them up again. This seems to be the only solution.

Tags:

Linux

Tar

Osx