Skip to content

Why do I get files like ._foo in my tarball on OS X?

5. December 2011

Problem
When I tar a directory in OS X Lion:

tar -cf foo.tar foo

It produces an extra file ._foo in the tarball:

._foo
foo

Cause
The extra file “._foo” is a Mac OS resource fork
It is created by tar on Mac OS X (Lion and earlier versions)

Solution
Set environment variable in your shell, before executing the tar command

COPYFILE_DISABLE=1 tar -cf foo.tar foo

Links

Advertisements
Leave a Comment

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: