Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Load .bash_profile for every terminal

Tags:

bash

unix

macos

I set up some aliases in my .bash_profile on my Max OS X. It works but when I'm opening a new tab I always have to load my .bash_profile file with this command:

source ~/.bash_profile

How can I make it work for every terminal I'm opening, even if I'm restarting my Mac or Linux computer?

like image 797
Kevin Avatar asked Dec 18 '15 10:12

Kevin


People also ask

Where can I find .bash_profile in Linux?

The . bash_profile is used for customizing the user configuration settings. This file is located in the home directory and is mostly hidden.

Where can I find bash_profile in Mac?

Go the users home directory. Check if the bash_profile is visible there or not. If not, press Command + Shift + . and bash_profile will be visible.

Can you have multiple bash profiles?

bashrc files or any files which has your environment variables or even other data which you want in them, for example you can have three .


1 Answers

If you use oh my zsh , you can add source ~/.bash_profile line at the end of .zshrc file at the following path: /Users/YOUR USER NAME/.zshrc , then restart your Terminal/iTerm2 app.

Note that this file is hidden. You can press CMD + SHIFT + . in Finder to see it, Or just open it in default text editor with the following command from terminal:
open ~/.zshrc

like image 78
Sabrina Avatar answered Sep 23 '22 01:09

Sabrina