Can I list source for already defined bash functions?

A accidentally some changes to my bash configuration I keep in git by doing git reset --hard head in an incorrect directory. In particular some nifty functions I used. I have a terminal running which still has these functions loaded, can I still reconstruct them from the environment somehow?


If you defined them as functions in a file your sourced from something like .bashrc or .profile you should be able to use bash's type command.

$ type your_nifty_function

$ declare -f

will list all functions defined in the current shell.


declare will print out all the functions defined. (And all environment variables as well).


alias will print out all aliases defined.

Need Your Help

Showing help for a command-line utility

c# visual-studio-2008 .net-2.0

I have a command-line utility that gets quite a bit of downloads from my site. I'm trying to show the usage when a user uses the /? or /help parameters. I have a function called ShowUsage() that has

How to get other views in same ViewHolder at same position as the onClicked view (use in a RecyclerView Adapter)

android onclick android-recyclerview

I have a RecyclerView in my app that displays a row containing pictures and photographs downloaded from the internet. There is a photo and a button on screen. When the user clicks a button, I want to