Mac OSX Terminal

Adding color to your Mac OS X Terminal

Having a colorful terminal make life easier while working on the command line. Having color on your command line lets you distinguish between files, directories, symlinks and executable for example. By default, the terminal uses the default colors which would be white text for dark backgrounds or dark text for light backgrounds. The two files we need will either be none-existent or blank.

What is this Terminal you ask?

For those of you that know, this may seem as not needed. For those of you that don’t know, here ya go:

OS X Terminal is a program built into OS X. It includes a program called ssh which will allow you to make secure connections to UNIX computers. Terminal uses a command-line interface, so you’ll use the program by typing commands at a prompt. When you’re running Terminal, you’re using UNIX to access your Macintosh rather than the more familiar Aqua graphic interface. Terminal also includes the standard UNIX utilities scp (Secure Copy) and sftp (Secure File Transfer Protocol).

Configuring BASH

To find out what shell you are running, run this command:

echo $SHELL

Open your bash_profile config file for editing

vi ~/.bash_profile

If you are using a dark background, you will want to use this:

export CLICOLOR=1
export LSCOLORS=GxFxCxDxBxegedabagaced

If you are using a light background, you will want to use this:

export CLICOLOR=1
export LSCOLORS=ExFxBxDxCxegedabagacad
alias ls='ls -GFh'

Configuring VI

Open your vimrc config file for editing.

vi ~/.vimrc

Enter the following information if you are using a dark background

filetype plugin indent on
syntax enable
set background=dark

Enter the following information if you are using a light background

filetype plugin indent on
syntax enable
set background=light

Color Designators

  • a black
  • b red
  • c green
  • d brown
  • e blue
  • f magenta
  • g cyan
  • h light grey
  • A bold black, usually shows up as dark grey
  • B bold red
  • C bold green
  • D bold brown, usually shows up as yellow
  • E bold blue
  • F bold magenta
  • G bold cyan
  • H bold light grey; looks like bright white
  • x default foreground or background
Note: The above are standard ANSI colors. The actual display may differ depending on the color capabilities of the terminal in use.

Order of Distribution

  1. directory
  2. symbolic link
  3. socket
  4. pipe
  5. executable
  6. block special
  7. character special
  8. executable with setuid bit set
  9. executable with setgid bit set
  10. directory writable to others, with sticky bit
  11. directory writable to others, without sticky bit
Advertisements

Share your thoughts

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