Friday 4 September 2015

Cleaning up .DS_Store and .apdisk and other (._ files) on OSX CIFS and SMB

After stopping OS X from creating .DS_Store and .apdisk files on CIFS and SMB, here are the commands to clean up the files.

To see the hidden .DS_Store .apdisk and other (._files) use the following command:
defaults write com.apple.finder AppleShowAllFiles YES

To clean up the use of .DS_Store and .apdisk files use the following commands:
sudo find /Volumes/CIFSVOLUME -name ".DS_Store" -depth -exec rm {} \;
sudo find /Volumes/CIFSVOLUME -name ".apdisk" -depth -exec rm {} \;

To clean up other (._files) use the following command:
dot_clean --keep=dotbar /Volumes/CIFSVOLUME