Skip to content

Instantly share code, notes, and snippets.

@mileszs
Created December 22, 2008 21:35
Show Gist options
  • Save mileszs/39133 to your computer and use it in GitHub Desktop.
Save mileszs/39133 to your computer and use it in GitHub Desktop.
# Find all files containing a string with context
# Find all files containing a certain string, starting
# in the current directory, recursively.
# This will also provide some context, by printing 3 lines
# before and after the match (see the 'C3' argument to 'egrep').
find ./ -name '*.rb' | xargs egrep -nC3 'def initialize' | less
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment