LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 10-19-2013, 07:48 PM   #1
flebber
Member
 
Registered: Jan 2005
Location: Newcastle, Australia
Distribution: Slackware 14.1
Posts: 393

Rep: Reputation: 30
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.

Last edited by flebber; 10-19-2013 at 07:52 PM.
 
Old 10-19-2013, 07:50 PM   #2
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware: 12.1, 13.1, 14.1, 64-14.1, -current, FreeBSD-10
Posts: 1,658

Rep: Reputation: 571Reputation: 571Reputation: 571Reputation: 571Reputation: 571Reputation: 571
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.

Last edited by astrogeek; 10-19-2013 at 07:58 PM.
 
1 members found this post helpful.
Old 10-19-2013, 07:57 PM   #3
flebber
Member
 
Registered: Jan 2005
Location: Newcastle, Australia
Distribution: Slackware 14.1
Posts: 393

Original Poster
Rep: Reputation: 30
Thanks
 
Old 10-19-2013, 08:03 PM   #4
wildwizard
Member
 
Registered: Apr 2009
Location: Oz
Distribution: slackware64-14.0
Posts: 755

Rep: Reputation: 226Reputation: 226Reputation: 226
Quote:
Originally Posted by flebber View Post
Code:
bash-4.2$ su
Password: 
bash-4.2#
The # is the indicator that your root.
 
1 members found this post helpful.
  


Reply

Tags
konsole, root, su


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
no konsole prompt in mandrake 9.1 bcf2 Linux - Newbie 4 08-05-2009 11:13 PM
Konsole (BASH) prompt effects GrimSniffer Linux - Software 1 06-05-2008 12:10 PM
Konsole prompt drguitarum2005 Linux - Newbie 1 02-21-2005 01:57 AM
Suse Konsole prompt ? blavo Suse/Novell 6 10-13-2004 05:01 AM
Konsole prompt/commands UB_KMA Linux - Newbie 4 07-12-2002 12:31 PM


All times are GMT -5. The time now is 07:44 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration