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 have put an echo in three profile scripts that shows the file name so that I can see the order they run.

When I log in I see.

/etc/profile
/etc/profile.d/color-ls
~/.bashrc
/etc/bashrc
$ alias ls
alias ls='ls --ignore=*.pyc --color'

Yet when I start a screen session I see

~/.bashrc
/etc/bashrc
/etc/profile.d/color-ls
$ alias ls
alias ls='ls --color=tty'

The alias I've set up in ~/.bashrc is being overwritten by color-ls but only within screen, is there any round this annoying behaviour?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

You should first read man bash (section 'INVOCATION') about when which file is actually used.

Your little 'trace' shows you that your ~/.bashrc always sources /etc/bashrc which is then calling color-ls ... or not, depending on code in /etc/bashrc as it seems.

So, two ways to solve the problem:

  • Check, under which circumstances /etc/bashrc decides to not source color-ls.
  • Setup your aliases after your ~/.bashrc processes /etc/bashrc.
share|improve this answer
    
Thorough yet succinct answer. Thanks. –  StephenPaulger Feb 3 '11 at 17:26

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.