Walker News

How To Fix Linux ls Command Output Text Too Dark Problem?

I bet am not alone: when using ssh/Putty to access remote RedHat Linux server, the files and directories listing of ls command is too dark to read on the black background.

In this screenshot (below), directory appears in dark blue color is hardly see. Indeed, it’s painful and easily discourages young novices who have been using Windows since day one.

The problem of Linux ls command output text is too dark can be easily fixed by tweaking the LS_COLORS environment variable.

To fix it, as shown by the screenshot, one can tweak the LS_COLORS environment variable:
LSCOLOR=`echo $LS_COLORS | sed 's/00;/01;/g'`

which uses sed command to change all “00” to become “01”, that will effectively brighten ls command output text, i.e. make the directories listing easier to read on the black console!
The LS_COLORS is an environment variable used by ls command to display files in different colors according to file type.

To apply this tweak at wish, just create a simple shell script containing those two lines. If you would like to make LS_COLORS tweak persistently, just append that two lines to $HOME/.bash_profile file.

Custom Search

2017  •  Privacy Policy