How to Open .bash_profile file in Mac Terminal

The .bash_profile is a hidden configuration file for Bash Shell that you will find under the logged-in user's home directory.

The easiest way to get there is by opening the Terminal and typing cd ~

Next, you can make use of the nano editor, which is a very easy-to-use built-in editor in macOS.

To open the .bash_profile simply type nano ~/.bash_profile


Opening .bash_profile file on Mac
The .bash_profile file opened in Nano on Mac Terminal

Note: It is common that this file may not be present, if not created.

Once you make changes to this file, press Control + X followed by Y to save and Quit.

Finally, to apply the changes run the command source ~/.bash_profile in Terminal.

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:

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