Tips

How To: Reload Your .bash_profile

Today’s article is going to explain  how to reload your .bash_profile. It will be just a quick and easy article, one that won’t take up much of your time. It’s not all that complicated, but it’s something folks probably should know.

So, most of you will probably have a .bash_profile. There are other shells, but Bash is the most common. That’s where they store various bash settings. When you make changes to the .bash_profile, the profile needs to be reloaded for the changes to take effect.

I’ve probably covered this elsewhere, though I did write an article to show you how to find out which shell you’re using. If you don’t know, Bash is the name of the shell and stands for Bourne shell. There are many shells, but Bash was the first one ported to Linux. Indeed, it was one of the first applications ported to Linux. It’s still widely used as the default on most distros.

There are times when you’ll want to edit your .bash_profile for additional functionality. It’s where you’d go to change things like terminal output colors and you could even add aliases to the file if you really felt like it. (Those should probably bo in .bash_aliases, for the record.)

With that in mind, I’ll show you how to reload your .bash_profile.

Reload Your .bash_profile:

This article requires an open terminal, like many other articles on this site. If you don’t know how to open the terminal, you can do so with your keyboard – just press CTRL + ALT + T and your default terminal should open.

Like I said, this won’t be a very long article. It’s not terribly complicated.

Let’s say you’ve made a change to your .bash_profile and you want it to take effect immediately. To do that, you enter one of the following two commands:

source .bash_profile

Alternatively:

source ~/.bash_profile

You could also close all instances of the terminal and the new .bash_profile changes should take effect the next time you open the terminal. If you really want to have another way, you can reboot and the changes will take effect the next time you open the terminal as that too will reload your .bash_profile.

Closure:

See? I told you this would be a quick and easy article. It’s not all that complicated. You probably don’t need to reload your .bash_profile often, but now you know how to do so when you need to do so. Yup, it’s also another article. There are now more than 250 articles, by the way. Who knew that it’d turn into this?!?

Thanks for reading! If you want to help, or if the site has helped you, you can donate, register to help, write an article, or buy inexpensive hosting to start your own site. If you scroll down, you can sign up for the newsletter, vote for the article, and comment.

KGIII

Retired mathematician, residing in the mountains of Maine. I may be old and wise, but I am not infallible. Please point out any errors. And, as always, thanks again for reading.

Recent Posts

Update Python Packages (PIP)

We've had a run of Python packages recently and you can tell that I'm a…

5 hours ago

Save A Command’s Output To A File (While Showing It In The Terminal)

The title is the best I can come up with to describe this exercise as…

2 days ago

Demystifying journalctl: A Comprehensive Guide to Linux System Logging

It was suggested that I write an article about journalctl, which seemed like a large…

4 days ago

Extract Text From Multiple File Types

Today we will have a fairly simple exercise as we're going to just use a…

6 days ago

Meta: I’ve Been At This For Three Years!

I have not done a meta article lately. I don't find them interesting to write…

1 week ago

How To: Disable CPU Cores

This is not something everyone is interested in doing but you might as well learn…

1 week ago