Skip to content

Instantly share code, notes, and snippets.

@danielmwai
danielmwai / find-text-recursively.sh
Created Oct 24, 2018 — forked from rponte/find-text-recursively.sh
Finding files with specific text recursively using grep - unix
View find-text-recursively.sh
#!/bin/bash
# without regex pattern
grep --recursive --include=\*.java -nHIi "utf-8" /my/dir
grep --recursive --include=\*.{java,xml} -nHIi "utf-8" /my/dir
# with regex pattern
grep --recursive --include=\*.{xml,java,jspx} -nHIiE "(utf-8|iso8859-1|windows-1252)" /my/dir
##