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

anon@machinename.domain.poo:~/some/very/annoying/long/path$

to something like this:

anon@machinename.domain.poo:~/some/very/annoying/long/path
$

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.

link|improve this question

20% accept rate
feedback

migrated from stackoverflow.com May 11 '10 at 5:27

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

2 Answers

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\$ '

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

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

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

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.