Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

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

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

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

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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