Display bash shell function definitions with declare/typeset
February 16, 2012 14:57:35 Last update: February 16, 2012 14:57:35
You can use either
If you see a lot of functions with names starting with the underscore (
declare or typeset to list function definitions:
- To list all function names:
declare -F
- To display a function definition:
$ declare -f quote quote () { echo \'${1//\'/\'\\\'\'}\' }
If you see a lot of functions with names starting with the underscore (
_) and wonder where they come from, they are created by the scripts in /etc/bash_completion.d/.