Where is the setting that determines what the bash prompt looks like? Specifically on Arch, but I'm sure others would like to know for other distros too if it's different.
Speficially I'd like to use (K)Ubuntu's prompt
The environment Variables "$PS1" and "$PS2" set the prompt's look. You can check this howto in order to see all the different variables you can put in there. `
As tante said, you have to set the $PS1
(left prompt) (and optionally $PS2
(second line prompt)).
(Others variable exists on other shells like $RPS1
(right prompt) for zsh)
The best thing to do is to edit your .bashrc
file in your home directory and add something like :
export PS1=...
I will give you an additionnal link that I always find useful because there's a good list of the avalaible colors.
$PS2
is the prompt you get when writing a command over multiple lines, not the right prompt. The right prompt would be $RPS1
(and $RPS2
accordingly for multiple lines) on zsh - bash has no right prompt.
As others have said, this is determined by the environment vars PS1
and PS2
.
Ubuntu's default ps1
is: ${debian_chroot:+($debian_chroot)}\u@\h:\w\$
So you'll want to run the following:
export PS1=${debian_chroot:+($debian_chroot)}\u@\h:\w\$
To run that every time you log in, put it in your ~/.bashrc
file:
echo "export PS1=${debian_chroot:+($debian_chroot)}\u@\h:\w\$" >> ~/.bashrc
Since you asked specifically about Arch (well, it doesn't really matter, but it makes a nice excuse to add to the answers...), you should look at this entry in the Arch Wiki: Color Bash Prompt. And for even more fun, this thread in the Arch Forums: What's your PS1?. (Pages and pages of people trying to outdo each other with more and more elaborate prompts.... that's the typical Arch user for you.)