13
1
When I enter a eg. a new alias into my .bashrc
file I can't use it in that terminal window immediately and until recently I thought I had to restart the terminal to reload the .bashrc
file. Then I found out somewhere that if I write
. .bashrc
this will reload the .bashrc
file in the current window and I don't have to restart. This works fins but what is actually happening? Why does this reload the .bashrc
file?
1With
.
, you "source" the file. Meaning it is being executed basically – Der Hochstapler – 2014-03-14T09:22:23.027possible duplicate of What does source do?
– Dan D. – 2014-03-14T11:39:40.2931@DanD. while the answer is the same, the question sounds quite distinct to me. – Calimo – 2014-03-14T12:41:03.843
1
@Dan D. this question is more about the mening of . . Up until now I always thought about . as a shorthand for the current directory and .. as a shorthand for the parent directory. I never realised . was an alias for source (which in turn was a completely new concept for me).
If someone comes here and wants to know the difference I found What is the difference between executing a bash script and sourcing a bash script? to be very helpfull.