Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I just installed cygwin and everything is pretty good but, cygwin doesn't pick up .bashrc file.

vi ~/.bashrc
alias ls='ls -la --color'

after reopened a new cygwin terminal, the content is still there, but alias doesn't work. If I run alias ls='ls -la --color' in the terminal, alias works but it doesn't save to .bashrc file.

I am sure I am in the user home directory cd ~

someone could give me a hint? Thanks a lot

share|improve this question
up vote 3 down vote accepted

Probably, bash is being launched as a login shell. Login shells do not automatically use the content of .bashrc. If you want them to do so, you can create the file ~/.profile with this content:

[ -f $HOME/.bashrc ] && source $HOME/.bashrc

(as was mentioned in answers to this question, although they were not relevant to that case).

share|improve this answer
    
thanks for your answer. I created ~/.profile but got this error -bash: $'\r': command not found – olo Nov 7 '12 at 0:54
1  
That is because your editor used Windows line endings (CR+LF, or \r\n) instead of Unix line ending (LF, or \n, only). You can read more about it here, for example. You can probably solve the problem by running the dos2unix .profile command. – pino42 Nov 7 '12 at 1:05
    
dos2unix permission denied. I will try to get this sorted.thanks a lot – olo Nov 7 '12 at 1:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .