Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Every time I set a new alias in terminal and exit out it seem to forget them. Any ideas as to why that is?

I had Git installed too, but whenever I try to use it I get a command not found error.

share|improve this question

migrated from stackoverflow.com Aug 7 '12 at 2:24

This question came from our site for professional and enthusiast programmers.

2 Answers 2

That is the correct shell behaviour.

Edit your ~/.profile file and add the aliases there so they persist across sessions.

The git error is because your $PATH isn't set correctly; find where git is installed and add that to your PATH variable, again by editing the ~/.profile file.

share|improve this answer
    
It may not be .profile. It could also be .bash_profile or .bashrc. I like to keep my bash functions inside my .bashrc and my aliases and path stuff inside .bash_profile. I also do not have a .profile. –  edhedges Aug 2 '12 at 14:47
    
@edhedges I'm sure it's .profile, but I'm not at my Mac at the moment. If it doesn't exist, then substitute .bash_profile, as you say. –  trojanfoe Aug 2 '12 at 14:49
    
I have Mac OSX 10.6.8 and do not have .profile. That is why I commented. –  edhedges Aug 2 '12 at 14:50
    
@edhedges Doing a google for "mac .profile" shows that it appears to be the file used. –  trojanfoe Aug 2 '12 at 14:54
    
Like I said, I am just trying to help out with my personal Mac experience. That being said all three files will work for Terminal. –  edhedges Aug 2 '12 at 15:05
  • .profile will affect all shells for that user
  • .bashrc and .bash_profile will affect bash shells
  • Similarly, .csh_profile would affect csh shells, and so on

You can also use /etc/profile to apply changes for all users.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.