LinuxQuestions.org
Visit Jeremy's Blog.
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: 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 07:52 PM.
 
Old 10-19-2013, 07:50 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,362
Blog Entries: 24

Rep: Reputation: 4294Reputation: 4294Reputation: 4294Reputation: 4294Reputation: 4294Reputation: 4294Reputation: 4294Reputation: 4294Reputation: 4294Reputation: 4294Reputation: 4294
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: debian stable
Posts: 394

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: 875

Rep: Reputation: 282Reputation: 282Reputation: 282
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 / openSUSE 6 10-13-2004 05:01 AM
Konsole prompt/commands UB_KMA Linux - Newbie 4 07-12-2002 12:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:40 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
Open Source Consulting | Domain Registration