You need to give ls
the --colors=…
option (e.g. via an alias). To actually configure the LS_COLORS
environmental variable used to define the colours, one good way is to create a configuration file for dircolors
, e.g. with just bold (attribute 1) directories:
echo DIR 1 >~/.dir_colors
Then in your .bash_profile
or .bashrc
, eval
the output of dircolors
run on that file to set LS_COLORS
according to your configuration. The relevant lines in my .bashrc
(copied from somewhere) look like this:
if [ -n "$COLORTERM" ]; then
alias ls='ls -F --color=auto'
if [ -x "`which dircolors`" -a -r "$HOME/.dir_colors" ]; then
eval `dircolors -b "$HOME/.dir_colors"`
fi
else
alias ls='ls -F'
fi
Note that some terminals do not, by default, display the bold attribute as true bold but rather just use a brighter colour. You need to configure your terminal to get real bold.
See the dircolors --print-database
for an example of a “complete” configuration file.