Hey everyone! I'm trying to figure out where the $LS_COLORS variable is defined in my system. Can anyone help me with this? Thanks!
5 Answers
Just a heads up, make sure you're looking for `LS_COLORS` in all uppercase! Some distributions may handle this differently. Also, you could strace the bash command to see where it’s being set; that might help!
Have you tried running this command? `PS4='+${BASH_SOURCE}:${LINENO}[$?]> ' bash -xli < /dev/null | grep LS_COLORS` to see what the output is.
It really depends on your operating system and setup. For example, I found that for my configuration, the variable is not set at all. You can check by running `set | fgrep -i LS_Colors`.
You might need to check if you're using `dircolors` somewhere. It’s a command that can set up the LS_COLORS variable for you. You can find more information about it in the manual here: https://man7.org/linux/man-pages/man1/dircolors.1.html.
You could also use this command to search your system: `grep -ir "LS_Colors" / 2>/dev/null`. It might help you locate where this variable is defined.
Related Questions
Can't Load PhpMyadmin On After Server Update
Redirect www to non-www in Apache Conf
How To Check If Your SSL Cert Is SHA 1
Windows TrackPad Gestures