Remove .DS_Store files from Mac OS X

DS_Store files are automatically created by Mac OS X Finder in browsed directories. These files contain information about system configuration. If you upload them along with other files, the files can be misused to obtain information about your computer. For more information, see Apple security updates.

Remove all DS_Store files

  1. Select Applications > Utilities to launch Terminal.

  2. Enter the following UNIX command:

    sudo find / -name ".DS_Store" -depth -exec rm {} \;

  3. When prompted for a password enter your Mac OS X Administrator password.

Automatically remove DS_Store files periodically

  1. Select Applications > Utilities to launch Terminal.

  2. Enter the following UNIX command:

    sudo crontab -e

  3. When prompted for a password, enter your Mac OS X Administrator password.

  4. In the vi editor, press the letter I on your keyboard once and enter the following command:

    15 1 * * * root find / -name ".DS_Store" -depth -exec rm {} \;

    This crontab entry has the following format:

    <Minute> <Hour> <DayOfMonth> <Month> <DayOfWeek> <User Command>.

    The system automatically runs the command at 1:15 AM everyday. To configure the command for a different time, use different values.

    Note:

    This command is not run if your computer is switched off at the scheduled time.

  5. To save the entry, press the Esc key once, then simultaneously press Shift+Z+Z.

Additional information

For more details, see Mac OS X Hidden Files & Directories.

 Adobe

Get help faster and easier

New user?

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online