When packing and unpacking a tar file on OS X today, I find myself looking at things like:

tar tzf ../tanuki-3.5.6.tar.gz  

I don't think I've ever seem these extra files starting with a '.' before. If I x the file, ls -a does not show them. What are they?

3 Answers 3


They're resource forks. The Mac's filesystem supports multiple forks, and some Mac files have two, a data fork and a resource fork. Most file systems don't support multiple forks, so tools will split the resource fork into a separate file prefixed with ._.

  • 1
    Not quite -- they're AppleDouble header files that contain all the interesting additional file attributes that Mac files can have, that other filesystems (and archive formats like tar) don't natively support. In addition to the resource fork (is there is one), this includes Finder flags, type & creator codes, extended attributes, etc. Nov 16, 2010 at 0:47

I think you'll find that those files (or directories) came packaged within the .tar.gz file. Not normal, but any file can go into a tar.



For the sake of clarity about the issue, the following MWE illustrates what is happening:

cas$ tar --version
bsdtar 2.6.2 - libarchive 2.6.2
cas$ mkdir o
cas$ touch o/a o/b
cas$ tar cv o > /dev/null
a ./._o
a o
a o/._a
a o/a
a o/._b
a o/b

So each file and directory has a ._ file added to the tar file in the same directory, as mipadi said. This tar, let's call it mactar, avoids collisions by ignoring files beginning ._ in the input, e.g, with:

mkdir p && touch p/._a p/._b
cas$ tar cv p p/._b > /dev/null
a ./._p
a p

the existence of the p/._a file is simply ignored by tar, and so is the p/._b file, even though that is explicitly included in the CLI invocation. Thus, no collisions can occur.

Controlling tar

If you have a Unix background, you likely are unhappy about this behaviour. The mactar lacks the expected documentation: the man page is for the regular Free BSD tar and does not mention this idiosyncrasy.

However, the generation of the files for the meta forks can be disabled by setting an environment variable, so: export COPYFILE_DISABLE=true.


I'm not quite clear on the timing, but OSX began with the regular Free BSD tar, then Apple circulated an additional utility, tar_hfs that was the ancestor of mactar, and then, I think with Leopard, changed /usr/bin/tar to be mactar.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .