Adding color to your bash prompt

As a big mac user, one of my long time complaints have always been about color in my bash shell not translating over to a Linux host I’m ssh’ing into (predominantly CentOS/RHEL hosts).  A work around I’ve found to address this was to edit my .bashrc on linux systems I use as follows:

export LS_OPTIONS=’–color=auto’
eval `dircolors`
alias ls=’ls $LS_OPTIONS’

If you want color in your mac terminal you can add the following lines to your .bash_profile under your home directory in /Users (e.g. /Users/jdoe).

For dark terminal theme users:

export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced

For light terminal theme users:

export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad

Special thanks and credit to OSX Daily for the color OSX Terminal tips.

Edit:

So this above is all fine and dandy, but I’ve found that declaring terminal type as ‘terminal-color’ a better option for me.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s