public
Created

Bash Command / Bashrc Function to find any occurrence of a key phrase in files or filepaths

  • Download Gist
findit.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13
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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.