Skip to content

Instantly share code, notes, and snippets.

@mattchainsaw
Last active May 11, 2016 21:37
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mattchainsaw/946b30742a7bb784137c to your computer and use it in GitHub Desktop.
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>
#!/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