Sunday, January 03, 2016

.AppleDouble files on Linux

To get rid of those .AppleDouble files which OSX creates when accessing folders on Linux, first disable the creation of these files

defaults write DSDontWriteNetworkStores true

Then use the following script to remove every .AppleX file created:


if [ -z "$2" ]
               echo "Use --really to remove appledoubles"


if [ -z "$1" ]
               echo "No arguments supplied"
               echo "Use --really to remove .AppleDouble files"
               exit 1
               find $1 -name .AppleDouble -exec ls -d {} \;
               find $1 -name .AppleDesktop -exec ls -d {} \;
               find $1 -name .AppleDB -exec ls -d {} \;

if [ "$2" == "--really" ]
               echo "RUNNING DELETE"
               find $1 -name .AppleDouble -exec rm -r {} \;
               find $1 -name .AppleDesktop -exec rm -r {} \;
               find $1 -name .AppleDB -exec rm -r {} \;
               echo "Done. .AppleDouble files obliterated\n"
               echo "nothing"

No comments: