I've set up a chrooted environment using this tutorial. But the commandline isn't displayed correctly. Instead of the usual user@hostname:/home/user# it displays -bash-4.1$. What programs are needed to get the "default" linux commandline look?


You can edit the PS[1-4] environment variables to change the layout of your bash prompt. Check out http://www.thegeekstuff.com/2008/09/bash-shell-ps1-10-examples-to-make-your-linux-prompt-like-angelina-jolie/ for some examples.

  • How do I set these variables for every login? – Stuffy Oct 15 '12 at 9:08
  • If you want the prompt set for every login PS1 is what you're looking for. PS1 is the environment variable that defines the primary prompt string. It is set in ~/.bashrc. Add the following to .bashrc: export PS1="\u@\h:\w\a\$" (by convention # is reserved for root, a non-administrative user should use $ or >). – jaume Oct 15 '12 at 19:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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