Skip to content

Instantly share code, notes, and snippets.

@chrisallick
Created September 8, 2012 23:02
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 chrisallick/3680740 to your computer and use it in GitHub Desktop.
Save chrisallick/3680740 to your computer and use it in GitHub Desktop.
remove ds_store
There are a few solutions to resolve this problem. Below is a list of options:
To avoid creating .DS_Store files, do not to use the OS X Finder to view folders. An alternative way to view folders is to use UNIX command line.
To remove the .DS_Store files a third-party product called DS_Store Terminator can be used.
To delete the .DS_Store files from the entire system a UNIX shell command can be used.
Launch Terminal from Applications:Utilities
At the UNIX shell prompt enter the following UNIX command:
sudo find / -name ".DS_Store" -depth -exec rm {} \;
When prompted for a password enter the Mac OS X Administrator password.
This command is to find and remove all occurrences of .DS_Store starting from the root (/) of the file system through the entire machine.
To configure this command to run as a scheduled task follow the steps below:
Launch Terminal from Applications:Utilities
At the UNIX shell prompt enter the following UNIX command:
sudo crontab -e
When prompted for a password enter the Mac OS X Administrator password.
Once in the vi editor press the letter I on your keyboard once and enter the following:
15 1 * * * root find / -name ".DS_Store" -depth -exec rm {} \;
This is called crontab entry, which has the following format:
Minute Hour DayOfMonth Month DayOfWeek User Command.
The crontab entry means that the command will be executed by the system automatically at 1:15 AM everyday by the account called root.
The command starts from find all the way to \. If the system is not running this command will not get executed.
To save the entry press the Esc key once, then simultaneously press Shift + z+ z.
Note: Information in Step 4 is for the vi editor only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment