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.

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
add comment

1 Answer

up vote 2 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
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.