getting ls colors to work for non-root
Not sure what I'm doing wrong, but I cannot seem to get ls to display colors on Debian when the user is non-root. I even tried the same .bashrc from root and it still doesn't work. I never had this prob on the Slackware image. I'm assuming the prob lies outside the .bashrc file. I don't want to work as root all the time but I like being able to differentiate between files/dirs/scripts. Any help would be appreciated. Thanks!
-Brian
2 Replies
echo $TERM to see what it is and then compare that to the list in 'dircolors -p' to make sure your TERM is in that list. I actually hardcode my own colors in my .bashrc like this:
LS_COLORS='no=00:fi=00:di=01;33:ln=01;36:pi=40;33:so=01;35: \
do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32: \
*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31: \
*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31: \
*.deb=01;31:*.rpm=01;31:*.jpg=01;35:*.gif=01;35: \
*.bmp=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35: \
*.xpm=01;35:*.tif=01;35:*.png=01;35:*.mpg=01;35: \
*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:';
export LS_COLORS
You can do that if you know your terminal is supported but want to use a different TERM for some reason.
-Brian