shell commands 🔼

ls 🔼

ls / color 🔼

ls / color / history of colors in ls 🔼

The directory lister under UNIX is called ls. In the deep and distant past this was a very black and white affair. GNU has changed all that by introducing an environment variable called LS_COLORS which allows you to set the colours of files based on extension, permissions and file type.

ls / color / display NO colours 🔼

$ ls --color=never

ls / color / variable LS_COLORS / about 🔼

LS_COLORS environment variable is responsible for the colors that you see when you run the ls command.

The LS_COLORS environment variable can change the default color settings.

ls / color / variable LS_COLORS / checking current value 🔼

See it's curret value: $ echo $LS_COLORS rs=0:di=01;34:ln=01;36:mh=00:pi=40;33

ls / color / variable LS_COLORS / permanent changes 🔼

By default LSCOLORS contain colors for all supported keys. If we want to change some colors we add in our ~/.bashrc : LSCOLORS="ow=01;90:di=01;36" export LS_COLORS and then : ~$ source .bashrc