You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Delete ._ Files from Network Drive

I've seen a number of discussions regarding this, but haven't found anything that has a straight forward, idiot proof method. I'm no Terminal wizard so all these lines of commands with no explanation mean nothing to me, I'm hoping someone can explain a relatively simple (or copy and paste) command I can use!


I have hard drive attached to my router working as a NAS drive, which is my main source for a media library (XBMC) running on a Raspberry Pi. I recently noticed that whenever I copied a file from my Macbook Pro onto that hard drive, XBMC would show two files that would appear exactly the same but one of them wouldn't play. When deleting these files I noticed that the "dead" files always started with a "._" before the normal file name.


My dad can see all these files and just delete them manually, but we have a massive media library and it's a total pain to sift through and do that as it'll take forever!


Is there a way, without using third party software that costs any money, to make these files visible within Finder so I can delete them from the network drive? They aren't a problem on my Macbook Pro so that's fine, I just want them off the network drive!


Any suggestions would be great, thanks 🙂

MacBook Pro, OS X Mavericks (10.9.5)

Posted on Apr 16, 2015 3:50 AM

Reply
Question marked as Top-ranking reply

Posted on Apr 16, 2015 10:27 AM

If the drive shows up in Finder, try double click it to see if it will mount.

3 replies

Apr 16, 2015 11:08 AM in response to guitarwizard93

These are 'dot underbar' files or 'Apple double' files.


OS X has a tool built in to clean these - it is a Terminal command

https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/ man1/dot_clean.1.html


The files are created when OS X stores files on a filesystem that does not support extended attributes - things like Spotlight comments or the 'downloaded from' URLs that are added to files from the internet. The get info dialog shows some extended attributes, but not all of them.

Deleting the files does lose this metadata.


You have a few options to clean them out…

A GUI app like Blueharvest (I haven't used this on network volumes).

http://www.zeroonetwenty.com/blueharvest/


A Terminal command on OS X, (attempt to merge & delete the files)

dot_clean -m /Volumes/Mounted-SMB-share


Or just delete them via 'find'

find /Volumes/Mounted-SMB-share -name ._\* -delete


Either of those can be wrapped up in a shell script, Applescript or Automator action to make it easy to run in the future.


A final option is to create a cron job on your server - frankly this is the best option - it can clean these files on a daily basis meaning you can forget about running it every time you get annoyed by them. The Pi server may also have the correct level of access too, since files shares can have permissions issues with many levels of directories mounted on other machines.



It is possible to show hidden files on OS X, however it is not very practical if you have more than a few folders to search through. I would seriously discourage this method, it's too easy to delete the wrong files when you are editing hundreds of files over a network in multiple folders. Viewing the invisible files & folders on the boot volume also encourages too much digging around too 🙂


NOTE: You may also want to remove .DS_Store files too. These store finder window info (sizes icon sorting options etc). The creation of these on network volumes can be disabled (if you use Terminal or an app like Secrets to set 'defaults write' values).

Secrets: "com.apple.desktopservices"


Ask if you want these explaining more - please verify the path to your shared disk inside /Volumes if you want help examining or altering those commands.

ls /Volumes

Will list all mounted disks in Terminal.

The paths on the raspberry pi will differ.

Delete ._ Files from Network Drive

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.