My OSX Bash Shell prompt

I’m rather fond of my bash prompt:

export PS1="\n`tput setaf 6`\w/    `tput setaf 7`(\u@\h)`tput sgr0`\n\$ "

it prints my full path,  then shows me who I am and on which (short) domain.. then on the next line.. a simple indicator as to if i’m root or not .. then the cursor..

Setting this permanently

  1. Change to your home directory cd ~
  2. Make / Edit your .bash_profile file by typing edit .bash_profile
  3. paste the export line into this text file and save it.
  4. All done!

UPDATE: I have now updated to Z-shell, which has fantastic git integration and an entirely new way to configure the prompt!

Leave a Reply

Your email address will not be published. Required fields are marked *