Redhat Linux - change directory color Redhat Linux - change directory color shell shell

Redhat Linux - change directory color


To specify the colors of the output of ls, you need to set LS_COLORS. In your .zshrc, try adding:

LS_COLORS="$LS_COLORS:di=00;33"

34 is blue, 33 is ... yellowish. Change that number and find what you like.

Use dircolors to get a feel for what LS_COLORS should look like and add -p to see a color list.


Joachim's answer is good for fixing the specific issue of directories, but if any other utilities output using the "blue" color, you will find them just as unreadable.

Different terminal emulators have different settings for changing the colors; my terminal emulator of choice reads X resources to determine what colors to use:

      URxvt.color0:   #000000      URxvt.color1:   #A80000      URxvt.color2:   #00A800      URxvt.color3:   #A8A800      URxvt.color4:   #0000A8      URxvt.color5:   #A800A8      URxvt.color6:   #00A8A8      URxvt.color7:   #A8A8A8      URxvt.color8:   #000054      URxvt.color9:   #FF0054      URxvt.color10:  #00FF54      URxvt.color11:  #FFFF54      URxvt.color12:  #0000FF      URxvt.color13:  #FF00FF      URxvt.color14:  #00FFFF      URxvt.color15:  #FFFFFF

color4 is the blue in question; I have mine set like this:

URxvt.background:       #000000URxvt.foreground:       gray75URxvt.color3:           DarkGoldenrodURxvt.color4:           RoyalBlueURxvt.color11:          LightGoldenrodURxvt.color12:          LightSteelBlueURxvt.color7:           gray75URxvt.colorBD:          #ffffffURxvt.colorUL:          LightSlateGreyURxvt.colorIT:          SteelBlueURxvt.cursorColor:      grey90URxvt.highlightColor:   grey25

This gives a black background, not-too-bright foreground, and most other colors are reasonable enough. (I too found the default blue unreadable.) I put these into my ~/.Xresources file, and they take effect after log in or after merging this file with the X resources database: xrdb -merge ~/.Xresources.

Of course, different terminals are configured differently. Check your terminal's manpage for more details on changing the colors of the usual colors.


You can see what is done in the global file, and then add it to your private ~/.profile (or similar file.)