{"id":1417,"date":"2011-03-08T23:32:54","date_gmt":"2011-03-09T05:32:54","guid":{"rendered":"http:\/\/icesquare.com\/wordpress\/?p=1417"},"modified":"2016-03-02T11:48:37","modified_gmt":"2016-03-02T17:48:37","slug":"how-to-remove-ds_store-and-appledouble","status":"publish","type":"post","link":"https:\/\/icesquare.com\/wordpress\/how-to-remove-ds_store-and-appledouble\/","title":{"rendered":"How to remove .DS_Store and .AppleDouble"},"content":{"rendered":"<p style=\"margin-bottom:50px;\">If you&#8217;ve shared your Windows \/ Unix drives with Mac OS X before, you may notice that Mac OS X will leave some footprints on your shared folders, such as <strong>.DS_Store<\/strong> and <strong>.AppleDouble<\/strong>. These files and directories are pretty annoying because they showed up in almost every single directory you accessed from the OS X.<\/p>\n<p>There are two ways to solve this computer problem:<\/p>\n<ol>\n<li>Ask Apple to stop generating the .DS_Store<\/li>\n<li>Delete .DS_Store by yourself<\/li>\n<li>Set the shared folder to read-only<\/li>\n<\/ol>\n<p>Apple had a tutorial on how to stop generating the .DS_Store (See <a href=\"http:\/\/support.apple.com\/kb\/HT1629\" target=\"_blank\">here<\/a> for details), however this solution requires you to run the command on every single account on every mac.<\/p>\n<blockquote><p>\n&#8230;If you want to prevent .DS_Store file creation for other users on the same computer, <strong>log in to each user account and perform the steps<\/strong> above&#8230;\n<\/p><\/blockquote>\n<p>In the other words, you will need to run the command for <strong>(# of user on each mac)<\/strong> x <strong>(# of mac)<\/strong> times! <\/p>\n<p>For example, if you have 5 users on each mac, and you have 4 macs. You will need to run the command for 5 x 4 = 20 times! Also, I&#8217;ve tried this method before and the problem seemed coming back after the upgrading the system (e.g., from OS X 10.7 to 10.7.1). Therefore I decide to go with the second solution: Delete .DS_Store by myself.<\/p>\n<div style=\"border-top:1px dotted #999; margin-bottom:10px;\"><\/div>\n<h2>How to delete .DS_Store and .AppleDouble automatically<\/h2>\n<p>Depending on what operating system the shared drives locate, there are two different ways to solve this problem, and they are very similar.<\/p>\n<h3>Situation 1: The shared folder is on Windows<\/h3>\n<p>If the shared folder located on a Windows machine, you may want to delete .DS_Store and .AppleDouble from the OS X. First, go to Terminal first:<\/p>\n<p>Create a script<\/p>\n<pre>\r\nnano clean.sh\r\n<\/pre>\n<p>Now you are in a text editor. Copy and paste the following into the editor:<br \/>\n<\/p>\n<pre>\r\nfind . -name \".DS_Store\"        -exec rm -Rf {} \\;\r\nfind . -name \".apdisk\"          -exec rm -Rf {} \\;\r\nfind . -name \".AppleDouble\"     -exec rm -Rf {} \\;\r\nfind . -name \".AppleDB\"         -exec rm -Rf {} \\;\r\nfind . -name \"afpd.core\"        -exec rm -Rf {} \\;\r\nfind . -name \".TemporaryItems\"  -exec rm -Rf {} \\;\r\nfind . -name \"__MACOSX\"         -exec rm -Rf {} \\;\r\nfind . -name \"._*\"              -exec rm -Rf {} \\;\r\n<\/pre>\n<p>Save the file. Don&#8217;t forget that we need to make it executable.<\/p>\n<pre>\r\nchmod a+x clean.sh\r\n<\/pre>\n<p>Now you can run the script:<\/p>\n<pre>\r\n.\/clean.sh\r\n<\/pre>\n<p>Unfortunately, OS X will recreate these files again after the files are removed. Therefore, I create a cron job to remove them automatically:<\/p>\n<pre>\r\nsudo nano \/etc\/crontab\r\n<\/pre>\n<p>and put the following:<\/p>\n<pre>\r\n@hourly       root \/path.to\/script.sh\r\n<\/pre>\n<p>This will tell the system to run the script hourly.<\/p>\n<p>Of course, you can change it to daily, weekly, monthly etc.<\/p>\n<div style=\"border-top:1px dotted #999; margin-bottom:10px;\"><\/div>\n<h3>Situation 2: The shared folder is on OS X or Unix<\/h3>\n<p>The idea is very similar. You can do the same thing except that the script will be on the server side.<\/p>\n<p>Or you can simply make the shared folder to read-only. Then Mac OS X can not create any annoying files. Here is an example on how to set up a read-only shared drive on Samba:<\/p>\n<pre>\r\n[Public]\r\n        browseable = yes\r\n        writeable = no\r\n        path = \/public\r\n        force directory mode = 777\r\n        force create mode = 777\r\n        comment = This is a public directory\r\n        create mode = 777\r\n        directory mode = 777\r\n        available = yes\r\n<\/pre>\n<p>Now you can say goodbye to .DS_Store and .AppleDouble.<\/p>\n<p>&#8211;Derrick<\/p>\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you&#8217;ve shared your Windows \/ Unix drives with Mac OS X before, you may notice that Mac OS X will leave some footprints on your shared folders, such as <a class=\"more-link\" href=\"https:\/\/icesquare.com\/wordpress\/how-to-remove-ds_store-and-appledouble\/\">Continue Reading &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":2524,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[94,144,6,69],"tags":[140,117],"class_list":["post-1417","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-computer-problems-computer-help-pc-support","category-sever-problem","category-technology","category-troubleshooting-technology","tag-ds_store","tag-osx"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/p1sqzr-mR","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":41,"url":"https:\/\/icesquare.com\/wordpress\/installing-apache-php-mysql-and-memcached-on-os-x\/","url_meta":{"origin":1417,"position":0},"title":"Installing Apache, PHP, MySQL and MemCached on OS X","author":"Derrick","date":"May 19, 2009","format":false,"excerpt":"This is my note on how to to install Apache, PHP and MySQL on a an OS X box. Although some of these applications are come with the operating systems, it is always good to know how to upgrade them to the latest version. 1. Apple Developer Tools and Mac\u2026","rel":"","context":"In &quot;Server Problems&quot;","block_context":{"text":"Server Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/sever-problem\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":351,"url":"https:\/\/icesquare.com\/wordpress\/installing-apache-on-snow-leopard-os-x-10-6\/","url_meta":{"origin":1417,"position":1},"title":"Installing Apache on Snow Leopard (OS X 10.6)","author":"Derrick","date":"October 30, 2009","format":false,"excerpt":"The Apache web server comes with the OS X is a bit out dated. So I decided to install a new one. After I tried installing it using mac port, it kept giving error. Finally, I built the Apache from source, and it worked! Grep Apache from here. Download the\u2026","rel":"","context":"In &quot;Server Problems&quot;","block_context":{"text":"Server Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/sever-problem\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2777,"url":"https:\/\/icesquare.com\/wordpress\/solvedproblem-to-update-openldap-in-freebsd\/","url_meta":{"origin":1417,"position":2},"title":"[Solved]Problem to Update OpenLDAP in FreeBSD","author":"Derrick","date":"April 29, 2012","format":false,"excerpt":"Recently, I found the following error message when updating my FreeBSD system regarding to the OpenLDAP: ===> Installing for openldap-client-2.4.31 ===> Generating temporary packing list ===> Checking if net\/openldap24-client already installed ===> Creating users and\/or groups. Using existing group `ldap'. Creating user `ldap' with uid `389'. pw: user 'ldap' already\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":2523,"url":"https:\/\/icesquare.com\/wordpress\/how-to-clean-up-reset-user-account-to-default-on-linux-ubuntu-fedora-automatically\/","url_meta":{"origin":1417,"position":3},"title":"How to Clean Up \/ Reset User Account To Default on Linux, Ubuntu, Fedora Automatically","author":"Derrick","date":"January 17, 2012","format":false,"excerpt":"Imagine that you set up a computer at a public location, such as cafe, library, or computer lab in your school, so that any one can use your computer. Most of the time, users mainly use the web browsers for surfing the web, checking the email, or updating the status\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1684,"url":"https:\/\/icesquare.com\/wordpress\/these-files-might-be-harmful-to-your-computer-your-internet-security-settings-suggest-that-one-of-more-files-may-be-harmful-do-you-want-to-use-it-anyway\/","url_meta":{"origin":1417,"position":4},"title":"These files might be harmful to your computer &#8211; Your internet security settings suggest that one of more files may be harmful. Do you want to use it anyway?","author":"Derrick","date":"October 22, 2011","format":false,"excerpt":"I run my own network drive such that all computers in my network can access the same files. Every time when I try to access the shared files from Windows 7, it comes with nightmare (a gift from Microsoft). For example, if I move files within the network drive, Windows\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"\/wordpress\/wp-content\/uploads\/2011\/10\/Windows_Security_Annoying_Box.png","width":350,"height":200},"classes":[]},{"id":2122,"url":"https:\/\/icesquare.com\/wordpress\/delete-empty-system-mail-box-freebsd-linux\/","url_meta":{"origin":1417,"position":5},"title":"How to Delete System Mail \/ Empty System Mail box in FreeBSD \/ Linux?","author":"Derrick","date":"December 22, 2011","format":false,"excerpt":"[ad#adbrite] When I checked my FreeBSD system mail box today, I found that there were 8000 system mails sitting my mail box: mail Mail version 8.1 6\/6\/93. Type ? for help. \"\/var\/mail\/root\": 8182 messages 8182 new >N 1 root@localhost.my.do Fri Sep 30 03:02 44\/1330 \"x.com output\" N 2 root@localhost.my.do Fri\u2026","rel":"","context":"In &quot;Computer Problems&quot;","block_context":{"text":"Computer Problems","link":"https:\/\/icesquare.com\/wordpress\/category\/technology\/computer-problems-computer-help-pc-support\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"https:\/\/icesquare.com\/wordpress\/wp-content\/uploads\/2012\/01\/400px-broom_icon.png","_links":{"self":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1417","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1417"}],"version-history":[{"count":22,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1417\/revisions"}],"predecessor-version":[{"id":1426,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/posts\/1417\/revisions\/1426"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media\/2524"}],"wp:attachment":[{"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1417"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1417"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/icesquare.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1417"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}