Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to change the formatting on my BASH prompt from this:


to something like this:


The idea is that I would be able to type a reasonably long command on one line without it wrapping to the next line so quickly.

share|improve this question

migrated from May 11 '10 at 5:27

This question came from our site for professional and enthusiast programmers.

up vote 3 down vote accepted

Just add \n to your PS1 definition, for example, to change the default colour prompt that is included in Debian do this

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

share|improve this answer
Yeah, I just noticed that on another SO thread. Thanks. – Robert S. Barnes May 6 '10 at 9:59

Use the following line, which you can place in your ~/.profile

export PS1="\u@\h:\W\n\$"
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .