Once the database is built, you can use the where command to find your functions. Running where with no arguments will output a list of all registered plugins and aliases.
Add an argument to filter for a specific function or alias. By default only exact matches will return. If an exact match is found, just the file path of the originating script will be returned.
Options
-k Show all functions and aliases containing filter text
-a Show all functions and aliases fuzzy matched
-v Verbose output
-n Suppress line number in paths
-E Edit result
-h Show this screen
The -k switch turns on “apropos” mode, which lets you find any function containing the filter string in its name.
The -a switch takes “apropos” a step further, using the filter argument as a fuzzy search string. It will match any functions/arguments containing the characters in the search string in sequence, but they do not need to be contiguous.
If -a is specified, -k is ignored in the arguments.
-E causes $EDITOR to be opened with the path to the file containing the searched function. -E does not work with -k or -a.
-v will display a little more information in the output–such as command type–when used without -k or -a.
$ where git
/Users/ttscoff/.bash_it/aliases/custom.aliases.bash:69
$ where -v git
alias git is defined in /Users/ttscoff/.bash_it/aliases/custom.aliases.bash on line 69
You can customize the location of the text file where uses with the environment variable WHERE_FUNCTIONS_FROM_DB. Set it before sourcing the script in ~/.bash_profile:
To enable where to automatically index any file sourced in your
configuration, set the WHERE_HOOK_SOURCE variable to true before
sourcing _where.bash in ~/.bash_profile:
Set an expiration threshold on the database with WHERE_EXPIRATION. The threshold is in seconds, where one hour is 3600, and one day is 86400 (60 * 60 * 24). If where is initialized within the threshold since last update, it won’t index the files again.