Linux prompt

Hi all,

i m using  RED HAT LINUX 9.0  and it gives me # as default prompt, how can i change it $ ?
perlmnAsked:
Who is Participating?
 
PizentiosConnect With a Mentor Commented:
well, for one, i doubt that red hat would by default make the normal user prompt look like root, unless red hat has gotten stupid since i last used it. Where i come from, # is reserved for the root prompt and all other users use $. I have never seen any normal user have # for a prompt, even users that belong to the wheel group. It'd be nice if we got a reply with more information from perlmn about his system.

Perlmn:

Did you install it yourself? or did sombody else do it for you. If it was sombody else they might have changed your prompt on your normal user account for some reason to look like a root prompt. Although i don't know why they would.

Do you login as root? if so, you should really create a user account and use it instead of always been root, it's much safer. To create a new user account, it's somthing like adduser or somthing like that, although it might be different since i haven't used red hat in quite a few years.
0
 
sunnycoderCommented:
Hi perlmn,

In your ~/.bash_profile add a line
PS1=$'[\\u@\\h \\W]\\$
and after that export PS1 ....

on your command prompt execute

. ~/.bash_profile

Sunnycoder
0
 
fridomCEO/ProgrammerCommented:
Well it very much looks as if he's working under the root account. I would not want to have  a root shell having the same prompt as  a "normal" user....

Regards
Friedrich
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
Karl Heinz KremerCommented:
Friedrich is right, there is a reason why the root prompt looks different than a normal prompt. Try to log in as normal user, and see if the prompt you get is different (it very likely is). You should use Sunnycoder's method only to modify the prompt for a normal user, and never for the root user. You need to be able to see right away that you are logged in as root, because you can do a lot more damage to your system as root user. So everytime you see the '#' prompt, be extra careful.
0
 
majorwooCommented:
my personal favorite is:


###begin .bashrc file###

# Do not set PS1 for dumb terminals
if [ "$TERM" != 'dumb'  ] && [ -n "$BASH" ]
then
        export PS1='\[\033[01;31m\]\u@\h \[\033[01;34m\]\W \$ \[\033[00m\]'
fi

###end .bashrc file###
0
 
owensleftfootCommented:
0
 
ahoffmannCommented:
so much fun with a simple prompt :)



And as I see, most commentators do not cd to
 /this/dirwithalongnameandprobablyapproxiamtely90characterslongwhichwillmakethepromptveryusefull

*SCNR*
0
 
PizentiosCommented:
your definatly running as root.
0
 
ahoffmannCommented:
Pizentios, how would you proof that (except you have been logged in to perlmn's system)?
0
 
perlmnAuthor Commented:
Hi All

Many thanx to all of you, after your responses, I verified and I came to know that it was really root using # prompt  :-)

thanx again for u r great help



0
 
ahoffmannCommented:
perlmn, could you please explain how the graded answer helped you to change the prompt?
0
 
PizentiosCommented:
he didn't need to change the prompt....he was just loged in as root instead of a normal user.


-Pizentios
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.