To apply changes made to shell configuration files, you can use the source command or the . (dot) command followed by the file name. This will reload the configuration file in the current shell session without needing to restart the terminal. Here’s how to do it for common shell configuration files:
-
For
.bashrc:source ~/.bashrcor
. ~/.bashrc -
For
.bash_profile:source ~/.bash_profileor
. ~/.bash_profile -
For
.profile:source ~/.profileor
. ~/.profile -
For
.zshrc:source ~/.zshrcor
. ~/.zshrc -
For
.zprofile:source ~/.zprofileor
. ~/.zprofile
After running the appropriate command, any changes you made to the configuration file will take effect immediately in the current terminal session.
