Use Text preferences in Terminal to change the font, text, color, and cursor options for a Terminal window profile. To change these preferences in the Terminal app on your Mac, choose Terminal Preferences, click Profiles, select a profile, then click Text. Note: The options you choose in this preference pane apply only to the profile you select. Color.ui: This variable determines the default value for variables such as color.diffand color.grepthat control the use of color per command family. Its scope will expand as more commands learn configuration to set a default for the -coloroption. To add the colored ls output, you can add alias ls='ls -G'. To test, just run a source /.bashprofile to update your current terminal. Side note about the colors: The colors are preceded by an escape sequence e and defined by a color value, composed of style;color+m and wrapped in an escaped sequence.
This post explains how you can change the color of the Terminal prompt in Mac OS X.
It also covers how to activate the Terminal color layout, a very useful feature that displays different colors depending on the character of the file or folder.
Change the color of the Terminal prompt
To change the color of the Terminal prompt to a green color, open or create the file ~/.bash_profile and write:

#PS1='[u@h W]$ ‘ # Default
PS1=’[e[1;32m][u@h W]$[e[0m] ‘
where the first line is a comment indicating the default value, and
- e[1;31m indicates Red color
- u @ h W indicates the format of the prompt: user@host path.
- e[0m indicates format text reset
You can find more information about these special characters in this link. To activate these changes open and close the terminal, or run
source ~/.bash_profile
Activate colors in your Terminal
Activate colors is very easy. You only need to open the ~/.bash_profile file and add the following line:
export CLICOLOR=1

Save the file, and activate the changes like before.
Change the colors of your Terminal
Now, let’s learn how we can configure our Terminal to obtain the colors of the figure.
Colors can be changed using the LSCOLORS variable in the ~/.bash_profile. By default is set to
LSCOLORS=exfxcxdxbxegedabagacad
where the string exfxcxdxbxegedabagacad is a concatenation of pairs of the format TB, where T is the text color and B is the Background color.
The order of these pairs correspond to:
- directory
- symbolic link – special kind of file that contains a reference to another file or directory.
- socket – special kind of file used for inter-process communication.
- pipe – special file that connects the output of one process to the input of another.
- executable
- block special – a kind of device file.
- character special – a kind of device file.
- executable with setuid bit set (setuid is a short for set user ID upon execution).
- executable with setgid bit set (setgid is a short for set group ID upon execution).
- directory writable to others, with sticky bit – only the owner can rename or delete files.
- directory writable to others, without sticky bit – any user with write and execution permissions can rename or delete files.
And the different letters correspond to:
- a black
- b red
- c green
- d brown
- e blue
- f magenta
- g cyan
- h light grey
- x default color
The same letters in uppercase indicate Bold.
The Terminal default colors, described by exfxcxdxbxegedabagacad, and ordered by file type / text color / background color, are:

- ex –> directory / blue / default
- fx –> symbolic link / magenta / default
- cx –> socket / green / default
- dx –> pipe / brown / default
- bx –> executable / red / default
- eg –> block special / blue / cyan
- ed –> character special / blue / brown
- ab –> executable with setuid / black / red
- ag –> executable without setuid / black / cyan
- ac –> directory with sticky / black / green
- ad –> directory without sticky / black / brown
Mac Change Terminal Color
You can change the colors of your terminal by creating a new concatenated string, like
GxFxCxDxBxegedabagaced, and writing in the .bash_profile file the following line:
export LSCOLORS=GxFxCxDxBxegedabagaced

Enjoy the new Terminal layout! 😉
Don’t forget to g+1 if useful! Thanks!
Terminal User Guide
Customize Mac Os Terminal
Use Text preferences in Terminal to change the font, text, color, and cursor options for a Terminal window profile.
To change these preferences in the Terminal app on your Mac, choose Terminal > Preferences, click Profiles, select a profile, then click Text.
Note: The options you choose in this preference pane apply only to the profile you select. They don’t apply to the Terminal app in general.
Option | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Background | To change the background color of the Terminal window, click the Color & Effects color well, then select a color. To make the Terminal window translucent or transparent, click the Color & Effects color well, then adjust the opacity and blur using the slider. To set the opacity and blur for background windows, select “Inactive Windows.” To show a background image in the Terminal window, click the Image pop-up menu, choose Choose, then select an image. | ||||||||||
Font | To change the font used, click Change in the Font section, then select the font, typeface, and size. | ||||||||||
Text | You can use the text options to change the way text appears. To apply text smoothing, select “Antialias text.” To use bold for emphasis, select “Use bold fonts.” To allow text to flash on and off, select “Allow blinking text.” To display text using the colors embedded in some terminal emulator standards, select “Display ANSI colors.” To add emphasis to bold text with color, select “Use bright colors for bold text.” To change the color of the text, click the Text color well, then select a color. To change the color of bold text, click the Bold Text color well, then select a color. To change the color of the selected area, click the Selection color well, then select a color. | ||||||||||
ANSI Colors | To customize an ANSI color, click the color well, then select a color. | ||||||||||
Cursor | To change the cursor shape, select Block, Underline, or Vertical Bar. To change the color of the cursor, click the Cursor color well, then select a color. To have the cursor in the Terminal window blink, select “Blink cursor.” |
Customize Mac Terminal
