Can you make a bash profile available to future sessions even after system restart?

Is it possible to configure your bash profile and source it for future sessions rather than just the current session? lesson

In other words, can you make it available for future sessions, so that you can continue to use it even after system restart or until you decide to return to the default settings?

bash_profile is invoked when we login. So what you want, is already happening. The reason we use source is so we load the changes we made without having to logout/login or reboot.

1 Like

Okay! It’s clear now. Thanks a lot.

So what do you do when you want to revert to the default settings of the bash_profile or to the default bash_profile?

This is why you generally should make back up versions before editing config files.

Great! So How do you make a backup of your bash_profile so that you can revert to it whenever you want to?

you should know how to make backup of files? The better question is: what is good practice? You could name the file bash_profile.back for example

or if you want to keep multiple backups, copy the files and when pasting, add a date or date time at the end of the file name

1 Like

Awesome! Insightful reminder.

Thank you.