Last active
December 10, 2018 09:31
-
-
Save jobel-code/b166f5136a862b0ce6ddb4b4a8122a4a to your computer and use it in GitHub Desktop.
Bash collection of find files with given text
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
# List all the files that contains `Text to find` in the `dirpath` | |
grep -l "Text to find" ~/dirpath/* | |
# Find all the yaml files, case insensitive (-i) that have "Text to find" and save it to to a text file. | |
# add -r for recursion. | |
grep -i --include="*.yaml *.yml" "text to find" dirptahToSearch/* > ~/saveResultsHere.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment