Adding colour to LS output

By default the terminal in Mac OSX has colour turned off for the "ls" directory listing shell command.

Colour can be enabled by using the following environment variable in your shell:

export CLICOLOR=1

This can be added to your BASH environment on shell startup using the following command:

echo -e "\nexport CLICOLOR=1\n" >> ~/.bash_profile

The line will be appended to the end of your .bash_profile in your home directory (usually /Users/yourname). If the file does not exist it will be created.

As this file begins with a . it could be hidden from view in finder, so to check it's contents open a terminal and run the command:

cat ~/.bash_profile

Last updated: 08/04/2019