I am running Ubuntu Server 8.04 (hardy), and when I login remotely i can't see the colors when using ls, however after I type "bash" into the shell I see colors, I've already checked my .bashrc and all the colors are enabled by default (colors=auto), and I've checked "echo $SHELL" and "which bash", and they both report /bin/bash however as I already mentioned I don't see colors until I enter "bash" into shell Why might this be?

link|improve this question

feedback

2 Answers

up vote 1 down vote accepted

You need to either

  • Input your commands directly into ~/.bash_profile

  • Source your .bashrc from your ~/.bash_profile

e.g.

if [ -f ~/.bashrc ]; then
  source ~/.bashrc
fi

.bashrc is used for interactive shells, .bash_profile is used for login shells.

link|improve this answer
3  
By default Ubuntu provides a ~/.profile instead of a ~/.bash_profile. You might want to check for the existences of a .profile before you create a .bash_profile. – andol Jan 6 '10 at 21:28
Andol, your answer was the solution, I had manually created a ~/.bash_profile file instead of editing ~/.profile, and that's what was causing the issue. How can I accept your solution? – BassKozz Jan 6 '10 at 21:34
feedback

You could try using this command

echo exec bash -login > .login

Then the next time you log in the colors should work

link|improve this answer
Nope, I wouldn't recommend it. – Dennis Williamson Jan 7 '10 at 2:32
feedback

Your Answer

 
or
required, but never shown

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