Tag Archives: shell

Terminal coloring

Ah, the wonderful world of the command line. I wouldn’t be able to look at myself in the mirror (and by mirror, I mean reflection in my monitor) if I couldn’t play the shell as if it were a finely tuned 128-key instrument. But I like to add a little pizzaz to the very black-and-white (or black-and-amber, or black-and-green) world of Terminal.

To do this, one adds ANSI color codes to things. Pass a proper flag or two to ls, set CLICOLOR in your environment, and most of all, set your PS1 to something interesting. Here’s mine for my local machine:

PS1='\[\033[35m\]\u@\h\[\033[00m\]:\[\033[94m\]\w\[\033[96m\]\$\[\033[00m\] '

The result looks something like this:

gwynne@localhost:~/Desktop$ _
Continue reading