Skip to content

Instantly share code, notes, and snippets.

@heyfletch
Created October 13, 2012 21:10
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 heyfletch/3886154 to your computer and use it in GitHub Desktop.
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
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