-1

Can someone explain the difference between .bashrc and .bash_profile? Examples would be great.

Thank you.

Legio06
  • 17
  • 1
  • 7
  • [This](https://blog.flowblok.id.au/2013-02/shell-startup-scripts.html) is a very nice article about shell startup files. And the [manual](https://www.gnu.org/software/bash/manual/bash.html#Bash-Startup-Files) talks about it as well. – Benjamin W. Dec 13 '18 at 03:00
  • Thank you BenjaminW I read briefly the article but I think I need to read it again and sit in front of my ubuntu machine. One thing I am also trying to understand is “Environmemt” I install software (open source) for research and I am often asked to edit the .bashrc file and include $PATH which is another whole question by itself. – Legio06 Dec 13 '18 at 16:23

1 Answers1

0

/.bashrc and ~/.bash_profile are scripts that might be executed when bash is invoked. The ~/.bashrc file gets executed when you run bash using an interactive shell that is not a login shell.

So basically bashrc is run when you run an interactive shell that you're not logged in for and bash_profile is executed when you are a logged in user.

Have a further read here: https://www.quora.com/What-is-bash_profile-and-what-is-its-use

Sweet Chilly Philly
  • 3,014
  • 2
  • 27
  • 37
  • Thank you Sweet Chilly Philly. One thing I am also trying to understand is “Environmemt” I install software (open source) for research and I am often asked to edit the .bashrc file and include $PATH which is another whole question by itself. Understanding the difference between .bash_profile and .bashrc – Legio06 Dec 13 '18 at 16:25