How to Configure Mac Terminal to have Color is Output


You can easily configure Mac Terminal to have colour is output. It is really useful to identify terminal outputs.
You can customize color output settings for both light and dark terminals and also you can get a preview of color is output.
1. Open Terminal App from Applications -> Utilities folder.
2. Type or paste the following command.

nano .bash_profile

3. Use the arrow keys to navigate the document and paste the one of the text below. I mean edit the ~/.bash_profile or ~/.profile and add the following two lines.
Set Colors for Dark Terminal Themes

export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced

or
Set Colors for Light Terminal Themes
export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
Mac Terminal color
After you added strings in bash_profile the file is looking like this
Color Terminal Mac OS X
4. Press the Control + O key combination to save the file and open new Terminal window.
Type ls -la or ls to confirm colorized Terminal output.
5. Optionally you can add

alias ls='ls -G'

to ~/.bash_profile to get coloured ls output
If you knew any other methods to set terminal output color, inform us via comment.

3:43 pm

Leave a Reply