Macos – Bash color shell on Mac

bashmacosshell

How can you make a bash shell list executable files in a different color than non-executable files?

I've tried editing ~/.bashrc to contain the following line (it's otherwise empty):

 LS_OPTIONS='--color=auto'

But it's not working. What am I doing wrong? I'm working on Mac OS X.

Best Answer

To turn on colour output from the ls command without having to create an alias to ls or download any additional software, add the following to your ~/.bash_profile:

# Terminal colours
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad

If you don't like those colours you can use this ls color generator to customize that color list to your liking.

You'll need to do:

source ~/.bash_profile

After making any changes for them to take effect in your existing shell.

Related Question