Bash – How to Find the Definition of a Function

bashshell

I work in an environment that has a lot of legacy shell script magic lying around. One thing used heavy from the command line are bash functions that get sourced from some file included from some file included from some file … included in my .bash_profile. Is there a way to get the definition or even better the location of the definition of these functions without tracking them down through 5 levels of includes?

Best Answer

To get the function definition:

type -a function_name
Related Question