How to customise your shell prompt

By default, the shell prompt on Mac OS X is somewhat cluttered so I customised it to be nice and minimalistic.

  1. Open your terminal

  2. Open your bash profile: vim .bash_profile

  3. In your bash profile file, add the following on a new line: export PS1="\$ \w: ". \w gives the Current working directory. If you are not root, \$ inserts a $. If you are logged in as root, you get a #.

  4. Logout from your Mac’s user session and log back in.

  5. Open Terminal.

And voilà!

More on how to further customise your shell prompt.