3

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

[email protected]:~/some/very/annoying/long/path$

to something like this:

[email protected]:~/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.

2 Answers 2

3

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

1
  • Yeah, I just noticed that on another SO thread. Thanks. May 6, 2010 at 9:59
1

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

export PS1="\u@\h:\W\n\$"

You must log in to answer this question.

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