Skip to content

Instantly share code, notes, and snippets.

@scottnath
Last active May 17, 2016 17:41
Show Gist options
  • Save scottnath/3750842 to your computer and use it in GitHub Desktop.
Save scottnath/3750842 to your computer and use it in GitHub Desktop.
find text inside a file on command line
find . -name '*' -exec grep -li 'text_to_search_for' {} \;
// ignore directories (won't show ".. is a directory")
find . -name '*' -exec grep -sli 'TEXT' {} \;
// exclude directories (like `node_modules`)
find . -name '*' -not -path './node_modules/*' -exec grep -sli 'TEXT' {} \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment