Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Note that I'm not trying to disable the creation of these files. I want to keep them around until I'm ready to commit changes to my source control.

The files are scattered throughout many subdirectories of the main source code directory and are of the format "._". For example, test.txt becomes ._test.txt.

I've tried this command, but it doesn't work:

rm -rf ._*

Any thoughts?

share|improve this question

3 Answers 3

While deleting them isn't particularly harmful, it'd be good to be sure you know what you're discarding since those are in fact neither temporary files nor unique to TextMate.

share|improve this answer

GNU find has a -delete option. If you have GNU find, this should work (and it should be immune to any problems with whitespace and other funny characters in file names):

find . -name '._*' -delete

From the documentation (info find):

-- Action: -delete
    Delete files or directories; true if removal succeeded.  If the
    removal failed, an error message is issued.

    The use of the `-delete' action on the command line automatically
    turns on the `-depth' option (*note find Expressions::).  This can
    be surprising if you were previously just testing with `-print',
    so it is usually best to remember to use `-depth' explicitly.

    If `-delete' fails, `find''s exit status will be nonzero (when it
    eventually exits).
share|improve this answer
    
OS X doesn't ship with GNU find though. –  slhck Oct 11 '11 at 22:08

Decided to use this instead:

find . -name "._*" -exec rm {} \;

However, I'd love to hear if there's a better way to do this.

share|improve this answer
    
Using find and xargs is a bit tricky. Read the find manual that says: "However, you may wish to consider the -print0 primary in conjunction with xargs -0". –  slhck Oct 11 '11 at 21:40

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.