I have in the past found a little annoying trait when decompressing files to a Linux box that have been compressed (zipped or tarred) on one of my Macs. Every file is duplicated and prefixed with ._
In the past it has only been a few files, no more than 50 or so which didn’t pose a great problem but today I have uncompressed a file with over 4000 files in it… and yes they were all duplicated. This makes a mess of the files structure.
I decided to research the issue and find away of preventing this from happening. I came across this post on Jim Plush’s blog.
By using the following command when decompressing will prevent the dot underscore files being added to the Linux box.
tar -zxpvf mytarfile.tgz ––exclude=”._*.*”
Let me know if anyone finds something else or has any issues / success with this.
EDIT,
Aside from the above, which seems to be failing and the issue has not gone away with prayer so I have been on the case this morning and have found a working solution.
tar zxpf test.tar ––exclude ._*
It seems that missing the speech marks from the file name and removing the equals has done the trick.








I noticed an error in the tarball syntax above. It should be;
tar -xzpvf mytarfile.tgz –exclude=”._*”
DOUBLE DASH before the word “exclude”…
Thanks for the post though it was most helpful!!!
Hey
Thanks for noticing this. There is a double hyphen there but only shows as one on the page…odd.
Fixed it by using the html for the hyphen,
–I will be posting some other commands soon. I have just been using “history” which is saving a lot of time.
Your website looks good too
Steve
Great post, thanks
I am new to mac and I’ve learned a lot from your blog here. Keep on going.
I’ve added an edit to the above post.
Pretty good post. I just stumbled upon your blog and wanted to say that I have quite enjoyed reading your blog posts. Any way I will be subscribing to your feed and I hope you article again soon.