This question already has an answer here:

When I tar multiple files up, I end up with an extra file for some reason.

What I am doing is:

tar -czvf tests.tar.gz test1.csv test2.csv test3.csv

When I look at the tar structure, for some reason I end up with:

 tar -tvf tests.tar.gz
-rw-------  1 admin Users 519 Jun  8 11:55 ./._test1.csv
-rw-------  1 admin  Users  52 Jun  8 11:55 test1.csv
-rw-------  1 admin Users 152 May 10 11:09 test2.csv
-rw-------  1 admin Users 152 May 10 11:09 test3.csv

I don't want the file ./._test1.csv . How do I create a tar that doesn't have this?

I am running this in OS X terminal.

marked as duplicate by muru, JdeBP, Jeff Schaller, Community Jun 11 '18 at 18:09

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


It's an Apple extension for storing extra file metadata.

Set the environment variable COPYFILE_DISABLE to turn this behavior off.


$ COPYFILE_DISABLE=1 tar -czvf tests.tar.gz test1.csv test2.csv test3.csv



The file in question is most likely an Apple extension and the reason for the presence of that file is most likely that you are using an Apple specific variant of tar.

You could compile an own tar binary without that "extension"...

Not the answer you're looking for? Browse other questions tagged or ask your own question.