Skip to content

Instantly share code, notes, and snippets.

@jbranchaud
Created November 16, 2012 17:44
Show Gist options
  • Save jbranchaud/4089338 to your computer and use it in GitHub Desktop.
Save jbranchaud/4089338 to your computer and use it in GitHub Desktop.
Quick search through a large Java project for a string
#!/bin/bash
# the first argument is the string you are looking for --> $1
searchString="$1"
for f in `find . -type f -name "*.java"`
do
result=`grep "$searchString" $f`
if [ "$result" != "" ]
then
echo $f
echo "| $result"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment