Wednesday, March 10, 2010

My .bashrc File Part 5 - Pimping the Prompt

This is the final installment of my .bashrc series. PS1 is a variable that allows you to change your prompt environment. Here is my setting as found in my .bashrc file which I use to get the prompt above.

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '

The numbers in the brackets represents colors. The \u option is username and \h is hostname which defines the first part of my command prompt. The second part of my prompt is indentified with /w which displays my current path which is shown above in blue.

Your possibilities are limitless when it comes to customizing your prompt and I don't have time here to list and explain all the options available, especially when the detail is readily available with a simple google search. Nevertheless, here are some links you might find useful to help pimp your prompt.

10 examples with syntax explanation.

This IBM article is a great resource as well.

I hope this series has been useful. Please share your pimped command prompt in the comments.

No comments: