Created
October 13, 2012 21:10
-
-
Save heyfletch/3886154 to your computer and use it in GitHub Desktop.
Bash Command / Bashrc Function to find any occurrence of a key phrase in files or filepaths
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
function findit() { | |
{ mlfind . -iname "*$1*"; | |
grep -irl "$1" . | |
} | sort -u | |
} | |
export -f findit | |
# Returns a list of filepaths where the key phrase occurs. | |
# Case insensitive | |
# Usage: | |
# findit keyword | |
# findit 'key phrase' | |
# findit 'key phrase' > output.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment