LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   A question about shell (bash shell) (http://www.linuxquestions.org/questions/linux-newbie-8/a-question-about-shell-bash-shell-750557/)

thomas2004ch 08-27-2009 01:28 AM

A question about shell (bash shell)
 
I log in to a linux and the shell looks as follow:
Code:

[root@s003ap02-test ~]#
Now I change to another user with su - myuser and the shell looks different as follow:
Code:

-bash-3.00$
What I want is somewhat like this:
Code:

[myuser@s003ap02-test ~]#
How can I change that?

linuxlover.chaitanya 08-27-2009 01:32 AM

# prompt is for root. $ is for normal user.

To get the # the prompt you need to be root.

vishesh 08-27-2009 01:49 AM

You can set whatever prompt you want
check enviroment variable PS1
By default prompt set by /etc/bashrc script.
Just check file /etc/bashrc, i think you will get your answer

thnks

tulsi 08-27-2009 02:00 AM

export PS1="[myuser@\h \W]"
display
[myuser@localhost ~]


if u want permanently above the name u will store .bashrc file.

colucix 08-27-2009 02:09 AM

Here is mine colorized in blue:
Code:

export PS1="\[\033[0;34m\][\u@linux \W]$\[\033[0m\] "
produces:
Code:

[alex@linux ~]$


All times are GMT -5. The time now is 07:17 PM.