LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-20-2002, 11:08 AM   #1
WeNdeL
Member
 
Registered: Oct 2002
Location: At my desk...
Distribution: RedHat, Fedora, Ubuntu
Posts: 344

Rep: Reputation: 30
Question File that defines root command prompt?


For RH 7.2:

what file is it that defines the default root command prompt?

I know you can modify the .bashrc file to alter this but I wanted to look at what makes up the root user's command prompt....

more specifically, what is it that displays the "#' or "$" symbol depending on what type of user you are...

I have tried \$ but this is reversed from what it should be.... when I say should be I mean:

# for root
$ for any other user (i believe)

thx in advance...
 
Old 11-20-2002, 11:24 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
that prompt itself is defined by the PS1 variable:

echo $PS1
 
Old 11-20-2002, 11:31 AM   #3
WeNdeL
Member
 
Registered: Oct 2002
Location: At my desk...
Distribution: RedHat, Fedora, Ubuntu
Posts: 344

Original Poster
Rep: Reputation: 30
ok.... I knew that but didn't think to look at where that variable was defined...

thx!
 
Old 11-20-2002, 11:34 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,378

Rep: Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963Reputation: 1963
normally a default is provided in /etc/bashrc, otherwise in ~/.bashrc as you already said.
 
Old 11-20-2002, 11:40 AM   #5
WeNdeL
Member
 
Registered: Oct 2002
Location: At my desk...
Distribution: RedHat, Fedora, Ubuntu
Posts: 344

Original Poster
Rep: Reputation: 30
my problem was this:

i had changed my PS1 to be this:

PS1="\u@\h \w\n\$ "

but this was needed to produce the desired effect:

PS1="\u@\h \w\n\\$ "

I have read about why this happens but just forgot...
 
Old 11-20-2002, 11:48 AM   #6
KevinJ
Member
 
Registered: Feb 2001
Location: Colorado Springs, CO
Distribution: Redhat v8.0 (soon to be Fedora? or maybe I will just go back to Slackware)
Posts: 857

Rep: Reputation: 30
there is a bash shell variable called "PS1"

"echo $PS1" to see what it is now, then change the symbol at the end

Example:

[root@cxo336745ew sysconfig]# echo $PS1
[\u@\h \W]\$

Note: There is a "\" before the $ because its an escape character.

[root@cxo336745ew sysconfig]# PS1="[\u@\h \W]% "
[root@cxo336745ew sysconfig]%

Then you can put it in your .bashrc file


-K.

Last edited by KevinJ; 11-20-2002 at 11:50 AM.
 
Old 11-20-2002, 12:28 PM   #7
WeNdeL
Member
 
Registered: Oct 2002
Location: At my desk...
Distribution: RedHat, Fedora, Ubuntu
Posts: 344

Original Poster
Rep: Reputation: 30
Re: File that defines root command prompt?

thx!

Last edited by WeNdeL; 11-20-2002 at 12:31 PM.
 
  


Reply


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
Given a URL how to grab a copy of the file from a command prompt ? Mike Davies Linux - General 2 07-16-2005 11:46 AM
How to run a text file through a command prompt? Fillys6 Linux - Newbie 8 03-24-2005 02:21 PM
execute php file on command prompt robberttheman Linux - Newbie 0 09-23-2004 01:24 PM
How do you copy and paste a file from a command prompt? thenewguy05 Linux - Newbie 6 07-13-2004 03:41 PM
How to play a wav file from the Command Prompt arraman Linux - General 1 08-02-2001 07:13 AM


All times are GMT -5. The time now is 12:56 PM.

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