LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   shell prompt (http://www.linuxquestions.org/questions/linux-server-73/shell-prompt-803151/)

abhijeetdutta 04-20-2010 07:05 PM

shell prompt
 
i am not able to login as [root@abc00 ~]# i am getting -bash-3.2# as shell prompt

how to recover it.

AlucardZero 04-20-2010 07:09 PM

that's your shell prompt, not a login prompt.

Code:

export PS1=" [\u@\h \w]# "
To make it permanent, add that line to root's ~/.bashrc

abhijeetdutta 04-21-2010 06:41 PM

your command works.thanks! but it will be more helpful PS1="[\u@\h \W]\\$ " when i have entered the command in bash_profile instead of bashrc.

catkin 04-22-2010 03:05 AM

Quote:

Originally Posted by abhijeetdutta (Post 3943250)
your command works.thanks! but it will be more helpful PS1="[\u@\h \W]\\$ " when i have entered the command in bash_profile instead of bashrc.

It is conventional for root's prompt to end in "# " as a visual reminder that you are running with awesome rootly powers.

A common solution to get the same interactive shell configuration for both login and non-login shells is to modify /etc/profile to include
Code:

if [ -f ~/.bashrc ]; then . ~/.bashrc; fi


All times are GMT -5. The time now is 10:19 PM.