How to remove hidden files in several folders (OS X 10.5)

We use OS X 10.5 for our file server, in an attempt to copy the files for one server to another, all files in the server had a 4kb hidden file created - i.e. identical file name, but only 4kb and the filename prefix is ".<space> " pls see screen shot.

I do not know if the hidden files are used by POSIX access rights control or due to some freak tool we used to copy/sync the folders.

Does anyone know of a unix script or command I can use to delete all these ". <filename>" from all the folders?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

try this:

first do a listing to make sure that these are the files you want to delete

find /path/to/parentdir -type f -name '. *'

second do the actual removal

find /path/to/parentdir -type f -name '. *' -exec rm {} \;


find /path/to/parentdir -type f -name '. *' | xargs rm

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
artradisAuthor Commented:
Thanks. I think this will work. But now the OS X is not able to see any hidden files so the find returns nought.

I will find a command to turn on viewing of hidden files in OS X.  Thanks.
open terminal and type

defaults write AppleShowAllFiles ON

then go to the apple menu and Force Quit and choose Finder, do what you need to do then in terminal type

defaults write AppleShowAllFiles OFF

then relaunch Finder again and you will be back where you started
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.