How to reload zsh shell profile file?


If you want to reload the zsh shell profile once you have made changes to the .zshrc file, make use of the source command.

The source command can be used in Unix-like operating systems to execute the contents of a shell script within the current shell environment, rather than launching a new shell to run the script.


Steps to reload zsh profile

  1. Make sure you are in the zsh shell, if not just type zsh in Terminal and hit enter.
  2. Now run the below command,
    % source ~/.zshrc

Once you run the source command followed by the location of zshrc file the zsh shell will be reloaded with the updated environment. Any changes you made to your configuration file will take effect immediately.


Note: if the file .zshrc is not present you will get en error.
source: no such file or directory: /Users/user/.zshrc

Gif Demo

Reload ZSH Shell GIF Demo

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap