How do I list the functions defined in my shell?

Dov picture Dov · Dec 17, 2010 · Viewed 89.6k times · Source

I can type alias to show a list of all the aliases.

But for functions, all I can do is grep my .bash_profile.

That only gets the ones in that file, not those defined in subsidiary files or dynamically.

Is there a more convenient way to find out what functions are currently defined?

Answer

The Archetypal Paul picture The Archetypal Paul · Dec 17, 2010

declare -F

Function names and definitions may be listed with the -f option to the declare builtin command (see Bash Builtins). The -F option to declare will list the function names only (and optionally the source file and line number).

Bash Reference Manual