Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

NOTE: This article is 3 years or older so its information may no longer be relevant. Read on at your own discretion! Comments for this article have automatically been locked, refer to the FAQ for more details.
I've noticed that when I use the OS X tar command that it adds a bunch of files that start with ._ to the archive. These files store extended file information and are useful on OS X, but on a system that does not understand them, they just add clutter.

Luckily there is a way to stop OS X from adding these files.

This is the kind of thing that I was seeing when testing an archive:
 Terminal output
> tar -tvzf update.tgz
-rw-r--r-- ikromin/staff 463 2015-02-05 22:47 fp-interface/themes/ik/._entry-default.tpl
-rw-r--r-- ikromin/staff 1831 2015-02-05 22:47 fp-interface/themes/ik/entry-default.tpl


To stop tar from including these hidden files, set the COPYFILE_DISABLE variable to 1 before running tar, like this:
export COPYFILE_DISABLE=1; tar -cvzf update.tgz fp-interface/themes/ik/entry-default.tpl


To go a step further, just add an alias to your ~/.profile:
 ~/.profile
alias tar='export COPYFILE_DISABLE=1; tar'




-i

Skip down to comments...
Hope you found this post useful...

...so please read on! I love writing articles that provide beneficial information, tips and examples to my readers. All information on my blog is provided free of charge and I encourage you to share it as you wish. There is a small favour I ask in return however - engage in comments below, provide feedback, and if you see mistakes let me know.

If you want to show additional support and help me pay for web hosting and domain name registration, donations, no matter how small, are always welcome!

Use of any information contained in this blog post/article is subject to this disclaimer.
 
comments powered by Disqus
Other posts you may like...