sites
sites

Reputation: 21775

How to reload all bash startup files in os x?

I could reload them in this order http://www.thegeekstuff.com/2008/10/execution-sequence-for-bash_profile-bashrc-bash_login-profile-and-bash_logout/ with source, but there is a short way?

I mean, a command that loads all files in its order, and not to do:

source /etc/profile
source ~/.bash_profile
source ~/.bashrc
source ~/.bash_login
source ~/.profile

Upvotes: 0

Views: 6616

Answers (2)

Swiss
Swiss

Reputation: 5829

It may not be the best, but here is a quick way to resource everything:

exec bash -l

The -l forces bash to work as a login shell, which should source /etc/profile.

Upvotes: 7

kizzx2
kizzx2

Reputation: 19213

Put this in your ~/.bashrc

rld() {
  source /etc/profile
  source ~/.bash_profile
  source ~/.bashrc
  source ~/.bash_login
  source ~/.profile
}

Now you can go rld whenever you want to reload all those files.

Upvotes: 5

Related Questions