Problem:
I have multiple bash functions and aliases. I can't remember all of them off the top of my head, so I usually end up opening my .bash_functions
and .bash_aliases
files to find what I need.
Question(s):
How can I list functions/aliases available from the bash prompt?
Is it possible for me to document my bash functions/aliases using comments (kinda like PHPDoc)?
I'd just like a simple/nice way to output what's available without having to open the files. It would be cool to run a command and have it spit out a dynamic list of my functions/aliases (usage examples would be a plus). 🙂
Best Answer
To list active aliases, run:
To see names of all active functions, run:
To see the names and definitions of all active functions, run:
More
The information on aliases is also available is a script-friendly format with:
man bash
provides more info on thealias
builtin:Regarding functions,
man bash
explains thatdeclare
can provide still more information is available if theextdebug
option is set:Links