find . -name "._*" -depth -exec rm {} \;
A script to remove .DS_Store files on any *NIX
Machine
Nov 28, '03 10:22:00AM •
Contributed by:
There have been hints here about removing those pesky
.DS_Store
files, but many fail under certain conditions (usually when there are
special characters in a file or folder name), or require BSD find. This
script has been tested on Debian Linux (Woody, 3.0r1). It does NOT work
on Jaguar (never tested on Panther), since it requires GNU find (tested
w/ version 4.1.7).
This removes all
.DS_Store files in the current directory and
its subdirectories.
rm gets a little upset if there are no such
files present, but this is minor (really only a problem if you put it
in a crontab or something like that).
#!/bin/bash
find . -name .DS_Store -printf \"%p\"\ \ | xargs rm