0

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?

2 Answers 2

3

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.

2
  • 4
    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, 2010 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, 2010 at 21:34
0

You could try using this command

echo exec bash -login > .login

Then the next time you log in the colors should work

1

You must log in to answer this question.

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