dot underscore file in Mac archive file

I have been using Mac since 10.5 Leopard, but somehow I just spot this problem today. If you make an archive from Terminal using tar and extract it on other system (Windows or Linux), you’ll find dot underscore (._*) file in the archive. For every file there’ll be one ._ file for it.

so what is this ._ file. According to a post from June 2006, it “just” holds some extra metadata to the file. The ._ file is not shown on HFS+ formatted drive, which Mac OSX uses, since it can hold extra metadata. But if the file is copied to other drive format, the ._ file holds the extra metadata.

Since I’m archiving some files and upload the to a webserver (linux based) the ._ files are created on Linux drive. I created a one-liner to remove all ._* recursively, but sometimes this extra step can be spared.

I found another hint to “disable” tar from archiving the ._ file. Just activate COPYFILE_DISABLE in .bash_profile.

or install tar from Brew.

and if you want to use gtar as tar, add following path in your profile file

somehow gtar version from Brew doesn’t create ._ file in the archive.

Happy tar-ing :)

Leave a Reply

Your email address will not be published. Required fields are marked *