Friday, December 13, 2013

Find a File with Certain Contents

I was trying to search for a file with a particular class name inside it, and I could not remember the syntax of the command to save my life.  I knew I had it in a note somewhere, but I couldn't find that either.

Tonight I found the note.  I'm posting the command here so I can find it again.

find . -name 'filepattern' -exec grep -l 'contentpattern' {} \;

No comments:

Post a Comment