LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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, 08:48 PM   #1
flebber
Member
 
Registered: Jan 2005
Location: Newcastle, Australia
Distribution: debian stable
Posts: 394

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 08:52 PM.
 
Old 10-19-2013, 08:50 PM   #2
astrogeek
Senior Member
 
Registered: Oct 2008
Distribution: Slackware [64]X{.0|.1|.2|-current} ::X>=12<=14, FreeBSD_10{.0|.1}
Posts: 2,165

Rep: Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848Reputation: 848
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 08:58 PM.
 
1 members found this post helpful.
Old 10-19-2013, 08:57 PM   #3
flebber
Member
 
Registered: Jan 2005
Location: Newcastle, Australia
Distribution: debian stable
Posts: 394

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

Rep: Reputation: 227Reputation: 227Reputation: 227
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-06-2009 12:13 AM
Konsole (BASH) prompt effects GrimSniffer Linux - Software 1 06-05-2008 01:10 PM
Konsole prompt drguitarum2005 Linux - Newbie 1 02-21-2005 02:57 AM
Suse Konsole prompt ? blavo Suse/Novell 6 10-13-2004 06:01 AM
Konsole prompt/commands UB_KMA Linux - Newbie 4 07-12-2002 01:31 PM


All times are GMT -5. The time now is 09:04 PM.

Main Menu
Advertisement
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