If one wants to have a customized prompt, one only has to edit the .bashrc file in one's home directory and add PS1="yourPrompt" at the very end.

What if one sudo su into the root and want to have a customized prompt automatically displayed?

  • Since you shouldn't really have to do much at an interactive root prompt (if anything), it is probably enough to leave it as #.
    – Kusalananda
    May 21, 2017 at 10:16

2 Answers 2


To change bash shell options for root, you need to edit/create /root/.bashrc with the options you need and switch to root either via regular login or su - (which can be called with sudo).


In GNU/Linux Fedora 32, run the followings commands to gaining root privileges or system administrator privileges.

sudo -i
type your owns password

If you want e.g. customize your root prompt of your terminal with powerline, you must edit /root/.bashrc file, then run

source /root/.bashrc

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.