Using grep to scan project files

Steve Neal Uncategorized Leave a Comment

To find a text pattern in a project, use grep to scan files:

grep --include=\*.{java,properties} -rnw . –e PATTERN HERE

the –include directive can be used to select the file types to check (in this case all .properties and .java files), -rnw for recursive with line numbers and word search, the dot is for the current working directory, a finally -e for the regexp to match.

Leave a Reply

Your email address will not be published. Required fields are marked *