Posted By

shaunchapman on 04/17/09


Tagged

mac windows Samba os x dot underscore shares


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

heinz1959


Remove Dot Underscore Files


 / Published in: Bash
 

Mac OS X creates files beginning with ._ to Samba shares when files on a Unix/Linux machine are accessed with a Mac. I use Coda to access a Samba share on my development server at work. This is really annoying when checking the status of the Subversion repository. So, I've come up with a solution to remove those files while ignoring similarly named files in hidden Subversion directories. This command will ask you to confirm that you want to remove each file.

For added convenience, I suggest making this an alias (add alias dot_clean='find . -name ".svn" -prune -o -name "._*" -exec rm -i {} \;' to the .bashrc, .bash_profile, or .bash_login file in your home directory). To clean a directory, simply type cd directory_name then dot_clean. Enjoy!

  1. find . -name ".svn" -prune -o -name "._*" -exec rm -i {} \;

Report this snippet  

You need to login to post a comment.