At work we're letting one of our very tech savvy clients actually help out a little with a few development projects specific to him. However, he uses his own personal Macbook, and as he edits files on our (Windows) networks, his Macbook always creates a bunch of unnecessary meta files that we end up deleting later.

For instance, it creates a file called .DS_Store in any directory he opens, as well as "dot underscore" files for each file he edits. So for instance, if he's editing a file called "Main.php", his Macbook will create another file called "._Main.php".

I know there are ways to prevent creation of .DS_Store files, but none about how to prevent creation of these hidden files prefixed with dot underscore.

Is there any way to turn that off on Macs? Any way to prevent it from creating those files in the first place?


10 Answers 10


Have your Mac user install BlueHarvest.

Blue Harvest

  • 11
    It's a commercial software. Anything else? Nov 20, 2012 at 16:38
  • It's worth noting that Ross Tulloch (the maker of BlueHarvest) offers a free version called BlueHarvest Lite. It is limited that you have to select and enable the feature for each new removable drive, but once set, it will keep that drive free of the junk. You can find it in the Mac App Store, however I'm not sure if it will work for network drives. You can give it a try.
    – ADTC
    Jul 1, 2014 at 8:30
  • 10
    It should be noted this solution does not really prevent a Mac from creating ._ files as OP asked. It simply removes the ._ files when you eject the drive. To me, it means "adding insult to injury".
    – some user
    May 19, 2015 at 23:30
  • Looks like the Lite version is no longer available. The download link just takes you to the paid App Store version.
    – davecave
    Aug 14, 2017 at 14:07

On Linux file servers or NAS devices you can use the following:

Option A. Samba configuration modification preventing both resource shares and .DS_Store files:

veto files = /._*/.DS_Store/

delete veto files = yes

(Configuration file located at /etc/samba/smb.conf or /etc/smb.conf depending on your distribution) Disadvantages: not all shares are provided by Linux-driven NAS systems, or on most you don't have shell access.

Option B. Create a simple shell script and run it from one of your connected machines using cron.

find /YourNetworkShareLocation -name '._*' -exec rm {} \;

Replace /YourNetworkShareLocation with where your network share is mounted, e.g. /Volumes/ShareName or /media/ShareName, etc.

Disadvantages: this is the brute's way - unnecessary load on both storage and network. However, the same can be easily done in Windows using a little PowerShell magic.

Disclaimer: This is not what I call "a solution", it's a hack. But it could help someone reduce the annoyance levels delivered by resource fork files.


Have him look into the free and aptly-named Cleanup SMB Mess application. The developer says:

This applescript droplet will clean up Windows shares mounted through the Mac OS X samba client, by removing all "._*" files, .DS_Store files and .Trashes folders on all the volumes and folders dragged on it."

I've only used with thumb drives and MP3 players, and it does what it says it does. I'm guessing it has to scan the device to remove the garbage, and that may be cumbersome on a large network share. But that's only speculation on my part. I'd suggest asking the developer.


Use a program other than Finder such as MuCommander to browse your files. (works on Local drives too).

In OS X lion, this method should allow default access to ~/Library without modifying settings or hitting ALT as well.

I use MuCommander on Snow Leopard and Lion and noticed that neither HFS+ or ExtFat volumes end up littered with files with these files.

Folks: there is another issue, File size... many of the resource forks at are least 4096 bytes even when the original file is under 4096 bytes so eliminating this problem does help with File System Bloat.

(For example: Download the Text file: http://www.gamers.org/pub/games/idgames/levels/heretic/g-i/horror.txt on a Mac and see for yourself)


You could also use a Mac app in the app store called 'Annoying File Be-Gone' that runs on the menubar and works well.


If you want to just manually remove those ._ files there's no need for external utilities or complicated find commands. In your terminal, just run

dot_clean /path/to/where/you/want/to/clean

Note that this is recursive, so you don't need to go into subdirectories manually.

You could even set up a cron task to automate this. In your terminal, run

crontab -e

Then in opened editor put in this and save:

0 0 * * * dot_clean /path/to/where/you/want/to/clean

This will automatically run every day at 00:00. Check out https://crontab.guru/ if you want to know how to construct a cron task.


On my QNAP NAS, the samba config in /etc/smb.conf already contained this:

veto files = /.AppleDB/.AppleDouble/.AppleDesktop/:2eDS_Store/Network Trash Folder/Temporary Items/TheVolumeSettingsFolder/.@__thumb/.@__desc/:2e*/.@__qini/.Qsync/.@upload_cache/.qsync/.qsync_sn/.@qsys/.digest/
    delete veto files = yes

so I edited the veto files line to:

veto files = /._*/.AppleDB/.AppleDouble/.AppleDesktop/:2eDS_Store/Network Trash Folder/Temporary Items/TheVolumeSettingsFolder/.@__thumb/.@__desc/:2e*/.@__qini/.Qsync/.@upload_cache/.qsync/.qsync_sn/.@qsys/.digest/

and then restarted samba (it's a primitive linux system so I did it via init.d):

/etc/init.d/smb.sh restart
  • /etc/smb.conf gets overwritten each time the server starts (or after running /etc/init.d/smb.sh restart). The (more) correct file to edit is /etc/default_config/veto_file.conf. You will still need to run /etc/init.d/smb.sh restart afterwards, and /etc/smb.conf will be regenerated.
    – Erhhung
    Sep 14, 2020 at 7:43
  • Ah, that sounds more sensible. It may not have been a feature on my NAS at the time, or perhaps I overlooked it! I don't run my QNAP NAS anymore, but should look at setting up the same thing for my current Samba shares. Sep 23, 2020 at 23:55


You could also try using TinkerTool (http://www.bresink.com/osx/TinkerTool.html) - it used to expose this setting.

  • Unfortunately, this doesn't cover creation of ._ metadata files.
    – Daniel Beck
    Jan 31, 2011 at 12:46

there is utility called "asepsis"

it is also has feature to clean your mac from .DS_Store files and so on read the FAQ


  • 1
    The FAQ makes no mention of ._ files.
    – DavidPostill
    Sep 16, 2015 at 16:48

This is really easy and you don't need to install anything.

  1. Open Spotlight (cmd+space)
  2. Type in 'Terminal.App'
  3. And press enter (This should open the Terminal application)
  4. Copy this to your clipbpoard (cmd+c):

    defaults write com.apple.desktopservices DSDontWriteNetworkStores true

  5. and paste it into the terminal (cmd+p)

  6. press enter
  7. close the terminal (cmd+Q)
  8. Next time you restart finder, your Mac will stop writing DS files on network storage.

Ref: http://support.apple.com/kb/HT1629

  • 4
    This link was already posted by the OP himself, who knows how to disable .DS_Store files from being created. The method does not prevent ._ files from being created though, as these are resource forks (and others) that are always written by the OS, even if you enable the DSDontWriteNetworkStores option.
    – slhck
    Apr 4, 2013 at 9:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .