Skip to content

Instantly share code, notes, and snippets.

@ckunte
Created June 11, 2020 01:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ckunte/df328ca09ab40ef556c08faf59a6b1b6 to your computer and use it in GitHub Desktop.
Save ckunte/df328ca09ab40ef556c08faf59a6b1b6 to your computer and use it in GitHub Desktop.
Getting rid of these pesky per-folder-setting files (.DS_Store)
#!/usr/bin/env bash
sudo find / -depth -name ".DS_Store" -exec rm {} \;
#
# Run these periodically via a cronjob. Type `sudo crontab -e` in
# a Terminal and enter the following job.
#
# 0 9 * * * root find / -name ".DS_Store" -depth -exec rm {} \;
#
# What this job does:
# At 9AM everyday (in the example below), root looks for .DS_Store
# files in all attached volumes and removes them.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment