LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Konsole prompt - indicate root (http://www.linuxquestions.org/questions/slackware-14/konsole-prompt-indicate-root-4175481446/)

flebber 10-19-2013 08:48 PM

Konsole prompt - indicate root
 
In my rc1 install when I go to Konsole and login as root there is nothing shown to indicate/remind me that I am logged in as root.
Code:

bash-4.2$ su
Password:
bash-4.2#

How can I customize the prompt to change when I have root access.
It also doesn't display where I am in the directory after I have cd.

astrogeek 10-19-2013 08:50 PM

I always add something like this to my /root/.bashrc

Code:

#Make prompt red when logged in as root
PS1="\e[1;31m[\u@\h:\w]#\e[m "

...which also adds user name and path to the prompt...

Also, if you do not have a /root/.bash_profile, you will need to create it and add these lines:

Code:

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

See man bash, INVOCATION for the precedence order of config files and how they are loaded.

flebber 10-19-2013 08:57 PM

Thanks

wildwizard 10-19-2013 09:03 PM

Quote:

Originally Posted by flebber (Post 5048814)
Code:

bash-4.2$ su
Password:
bash-4.2#


The # is the indicator that your root.


All times are GMT -5. The time now is 10:06 AM.