Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Kalixa

macrumors member
Original poster
Jun 25, 2007
73
0
I wish to make some aliases for bash such as alias ls="ls -G". The thing is I cannot find the .bashrc where, atleast in Linux, is the place to apply these aliases otherwise the aliases will disapeer when the terminal is closed. So does anyone know how to make these aliases in Mac OS X?

And as a site note, does anyone know where to place vim commands? In Linux there is also a .vimrc, which I have not been able to locate on my Mac.

Thanks.
 
I believe that all your environmental variables are stored in you .profile file, including aliases. Look around the home folder using ls -a to locate the hidden /bin and /usr folders and see if they are in there, otherwise, just create the .bashrc file and leave it in your home folder.

TEG
 
I believe that all your environmental variables are stored in you .profile file, including aliases. Look around the home folder using ls -a to locate the hidden /bin and /usr folders and see if they are in there, otherwise, just create the .bashrc file and leave it in your home folder.

TEG

Creating my own .vimrc seems to work, but creating my own .bashrc and placing my alias into it does not seem to work.
 
Once you update your .bashrc file you will need to start a new bash prompt. The easiest way is to either just type bash, or open a new Terminal window.

I know for myself when I set it up in Panther (and it still works in Leopard) I needed to put the following lines into my .bash_proflie file as well.

Code:
if [ -f "$HOME/.bashrc" ]; then
  . "$HOME/.bashrc"
fi

It then came into effect every time I made a new shell.
 
Once you update your .bashrc file you will need to start a new bash prompt. The easiest way is to either just type bash, or open a new Terminal window.

I know for myself when I set it up in Panther (and it still works in Leopard) I needed to put the following lines into my .bash_proflie file as well.

Code:
if [ -f "$HOME/.bashrc" ]; then
  . "$HOME/.bashrc"
fi

It then came into effect every time I made a new shell.

Nope, still doesn't work. This is how my .bashrc file located in my home folder looks:

if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi
alias ls="ls -G"

What could be wrong?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.