getting permanent color for ls?
Just wondering how I can get ls to always show color without me typing the switch. I tried editing my .bashrc with --color=always and I also tried --color=yes and --color=tty Nothing seems to work.
|
A simple alias ls 'ls --color=tty' line in the .bashrc file should work. I did that and it works fine. But then I use tcsh instead of bash (I edited .tcshrc instead of .bashrc ). I don't see how that would make any difference.
I hope that's helpful. -Robert |
thanks, but...
I appreciate the advice, but it doesn't seem to work; I'm not sure where the problem is. I tried adding
alias ls 'ls --color=tty' as well as alias ls='ls --color=tty' to .bashrc; neither of these seem to make any difference. Any other suggestions? |
What is your TERM environment set to? if its something like VT100 - a non-colour terminal then you'll never get colour nomatter what options you use! Run env | grep TERM to list it... Just a thought...
Jamie... |
well...
Typing env |grep TERM
only produces: TERM=linux Besides that, my monitor doesn't have any difficulty displaying color with ls. I just can't fathom why the changes to my .bashrc won't take effect. |
Put the line alias ls='ls --color=tty' in .bash_profile instead. That worked when I tried using the bash shell.
Is .bashrc even sourced? I don't usually use bash, but I tried it and it wasn't executing anything from .bashrc. I put an echo blah line in .bashrc and it didn't show up when I logged in. It showed up fine (and the color alias worked) when I typed source .bashrc after loggin in. It also showed up when I typed bash to run another bash shell inside the original. The .bash_profile file is sourced for sure, though. |
Just try alias ls='ls --color' or alias ls='ls --color=always' and see what happens.
|
I just sourced .bashrc, and everything works fine! Thanks, elconde.
|
All times are GMT -5. The time now is 12:52 AM. |