I put some alias commands in my .bashrc
file, so that they might be loaded everytime I open a new Terminal window. Yet this doesn't happen.
I have to select run script:
in the Terminal>Preferences>"MyDefaultTheme">Shell prefpane and add:
source .bashrc && clear
for it to work…
This seems odd since many tutorials only say you just have to add to the .bashrc
file and all is good.
Note that I don't run in bash
when using the terminal, I like the other (default) one (don't know what it is) better, because it show me where I am all the time eg:
>>d54c6b47b:~ romeo$
in stead of:
>>bash$
In bash all is loaded as should be.
So my question is, why didn't my .bashrc
file load automatically and did I have to add the option to call it everytime?
Also some tutorial told me to do something like:
$alias la=’ls -la’ >> ~/.bashrc
which should write the alias to my .bashrc
, this doesn't work either…
Note that I'm a UNIX novice, so be gentle.
Best Answer
Just put that in your
.profile
file from your home dir and it should work the next time you start a new shell or after you runsource ~/.profile
This link clearly states the order in which the startup files are read and loaded by the shell: http://hayne.net/MacDev/Notes/unixFAQ.html#shellStartup