Colored Bash

posted in: Free Software, Technology | 0

When I first opened the terminal in Mac OS X, I noticed two things: 1. The fonts looked awful. They did not antialias the fonts. I’m sure many of the hardcore UNIX-heads prefer it that way. Well, I’m used to KDE (http://www.kde.org) Konsole, which has nice looking fonts.

2. Like all BSD (http://www.bsd.org/)s, it uses tcsh by default instead of bash. Not a problem for me because, when I installed KDE (http://www.kde.org), Konsole defaults to bash.

Oh, wait, that makes three things I noticed. The third thing is that the terminal had no color. There was no color-coded “ls” that I’m used to with Linux (http://www.linux.org). It turns out that, for whatever reason, Apple did not ship it with the color coding. So, I downloaded fileutils-4.1 and compiled it. That gave me the color coding, but how to enable it by default?

Someone’s blog (http://en.wikipedia.org/wiki/Blog) (sorry don’t remember who) told me to use an alias in the “.bashrc” file in the home directory (i.e. ~/.bashrc). A simple one-liner:

alias ls=”ls –color=auto”

Now, I have pretty colors. Seriously, it’s not just so it looks nice. It’s a lot easier to tell what is a folder and what is a file when the folders are blue. Also executable files show up in green.

Huzzah!

Write a comment