I would like to the change the color of the directory listings in my SSH sessions on my Raspberry Pi. The blue color is very difficult to see on my 4K display. It appears I need to change the environment variable LS_COLORS to do this. I can't seem to find how to do this. Is my assumption correct about changing LS_COLORS and if so how do I do this?

1 Answer 1


Being a Pi Linux novice it took me until yesterday to realize I was looking for a hidden file. So using "echo $LS_COLORS >> colors" I was able to get the very long string that controls colors in the "ls" command response. I then edited the .bashrc file which I was finally able to see with "ls -a" (Thanks Ingo). I added the very long string to the end of the .bashrc file like this: LS_COLORS="very long string" Then I changed the "di=01;34" to "di=01;32" in the very long string. I also changed the prompt string defined in .bashrc which looks like this on my system: " PS1='${debian_chroot:+($debian_chroot)}[\033[01;33m]\u@\h[\033[00m]:[\033[01;34m]\w $[\033[00m]". I changed the "34m" in that line to "32m" All the Blues to Greens are much earier to see.

  • Actually the first part of my description above can be very much simplified. Simply add LS_COLORS=$LS_COLORS:'di=1;32' to the end of .bashrc. This will change the color of directory listings. Jul 11, 2021 at 17:32
  • You can even do something like this: LS_COLORS=$LS_COLORS:'di=1;32:*.py=01;36:' to change python file display colors. Jul 11, 2021 at 17:46

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