Clean up Mac ._ files on external/USB disk

Have you ever looked at an external drive with folders created on a Mac but then loaded on Windows or Linux? If you look carefully (turn on viewing of hidden and system files) you'll see a file beginning with ._ for some or many of your files, varying by file type. What are these mysterious '._xxx' files?

Mac OSX Resource Forks

Those ._ files are called resource forks. Resource forks are specific to Mac filesystems. They don't take up too much space and can contain useful data about your files. But deleting them also won't delete your files (the data forks) so is generally not a problem. If seeing the files in Windows or Linux is annoying to you then you can delete them from your external drive.

Cleaning up ._ files

On newer versions of Mac OS X, it comes with a dot_clean command which you can run in Terminal while passing it the path of a directory to clean. Don't clean root '/' but choose a mounted external disk. Run the mount command to see what disks were added into your '/Volumes/' directory and choose one of those. If your disk was named 'morestorage' then you could see it when you ran 'mount' and then run dot_clean /Volumes/morestorage.

On Linux or non-Mac operating systems, you can still delete those files recursively using the 'find' command. Given you are currently in the directory you want to clean (recursively) in a terminal, then run:

find . -name '._*' -type f -delete

This won't prevent the future creation of those ._ files again so you may need to run this again if you copy or create new files on the disk within Mac OS.

Add new comment