Custom BASH prompt

Here's the custom bash prompt I use. Copy the following line into your ~/.bashrc file to use it.

PS1='[e]0;wae[32m][email protected] [e[33m]w[e[00;$(($??31:00))m]n$ [33[00m]'

This will display:

[email protected] pwd $

where the $ prompt will be white when the previous command exited successfully and red when the previous command exited with an error code. The [email protected] is green, and the pwd is yellow.


Published: July 28, 2008

Author: jmhobbs

Word Count: 76


linux mac

  • Tag Cloud


    Copyright © 2015 Jared Hobbs. All rights reserved. Powered by Pelican. The Hobbs Family theme available here.