The easiest way would be to add this line to your ~/.bashrc
:
unalias -a
As far as I know, there is no equivalent for clearing all functions. You can, however, clear them one by one using
unset -f function_name
The following two bash options are also relevant:
--rcfile file
Execute commands from file instead of the system wide
initialization file /etc/bash.bashrc and the standard
personal initialization file ~/.bashrc if the shell is
interactive (see INVOCATION below).
--norc Do not read and execute the system wide initialization
file /etc/bash.bashrc and the personal initialization
file ~/.bashrc if the shell is interactive. This
option is on by default if the shell is invoked as sh.
So, you could set bash
to be an alias for bash --norc
:
alias bash='/bin/bash --norc'
That way, every time you manually launch bash
a new shell will be started with no initialization files. You would then need to manually source your .bashrc
.
I thought you could combine the --norc
and --rcfile
options to read your ~/.bashrc
only but could not get it to work.