Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I am editing bashrc constantly, and I have a terminal open with a working function definition, although bashrc has been updated with a wrong function definition. (Because the definition do not change until I source the updated bashrc) How can I look up the working function definition in this case? For example, if I type:

alias function_name

I can see what the definition is for that alias. Is there a command similar for function? If not, is there a command to output entire bashrc that the current terminal is using?

share|improve this question
up vote 8 down vote accepted
typeset -f function

displays the indicated function's current definition. It works in ksh (where it originated), bash and zsh. (n.b. in zsh, type -f, which, functions and whence -f also show the function definition.)

share|improve this answer
You can also use whence -cv in zsh. The -v option is to tell you, if there is no such alias or function (or otherwise executable in you PATH) at all. If you use it a lot (as I), you could alias it to a one-word command. – Emanuel Berg Nov 18 '12 at 20:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.