I've added the following lines to my .bash_profile at /Users/[my username] :

export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad

And it works fine. However, when I did the same for root's .bash_profile at /var/root it doesn't work. Any ideas why this doesn't work for root?

Thanks.

link|improve this question

75% accept rate
Yes, I know I'm supposed to use sudo. ;-) Nonetheless, I still would like to know how to enable this for root. – GeneQ Nov 3 '10 at 13:33
My root user's shell is /bin/sh according to dscl. Maybe that's the problem? – Daniel Beck Nov 3 '10 at 14:12
feedback

1 Answer

up vote 2 down vote accepted

You can toss those into ~/.profile or source the relevant file from ~/.profile inside the home directory for the root user, and then log in via sudo su - to simulate a full login. It works for me on BASH on Snow Leopard.

As a side note, I define the alias, alias ls='ls -G', in my .bashrc files to enable colour output for ls.

link|improve this answer
Changed the name of .bash_profile of root to .profile as you suggested and now it works beautifully. However, .bash_profile works for other users though. Thanks. – GeneQ Nov 3 '10 at 14:51
feedback

Your Answer

 
or
required, but never shown

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