Last active
May 11, 2016 21:37
-
-
Save mattchainsaw/946b30742a7bb784137c to your computer and use it in GitHub Desktop.
Poetry for Plebs. Recursively search for instance of a string in all files and subfolders. Usage: ./where.sh <regex>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find . -type f | | |
while read x | |
do | |
cat $x | egrep --color=always "$1" && | |
echo -e "\e[36m$x\e[0m" && | |
echo | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment