When you perform ls
in a bash shell, sometimes there are colours to indicate different resource types, and you can enable/control this with the --color
argument.
But neither the man page nor Google is providing an answer to the question:
What do these colours indicate by default, and how do I display what the current system uses?
UPDATE:
Thanks everyone for answers so far, however to make it easier to pick a winner, can anyone go a step further and provide a method to output descriptions in the colours they apply to.
Hmmm... my example doesn't work when posted (only when previewed), so if you preview this code it'll show what I mean...
<ul style="list-style:none; background:black; margin:0;padding:0.5em; width:10em">
<li style="color:blue">directory</li>
<li style="color:aqua">symbolic link</li>
<li style="color:#A00000;">*.tar files</li>
<li style="color:white">...</li>
</ul>
Thanks.
The colors are defined by the
$LS_COLORS
environment variable. Depending on your distro, it is generated automatically when the shell starts, using~/.dircolors
or/etc/DIR_COLORS
.Edit:
To list color meanings, use this script: