LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Command Prompt Color (https://www.linuxquestions.org/questions/linux-general-1/command-prompt-color-361328/)

init_linux 09-08-2005 01:44 AM

Command Prompt Color
 
Hello everybody,

I am using Fedora Core 3 and I want to change the color of my prompt, so that for root, I'll have one color and for non-root users, I can have different color.

Can anyone provide me a way to perform this.

Optimistic 09-08-2005 02:03 AM

Yep. Just creat a .bachrc file in root's home directory and your home directory with different prompt instructions.

In my home I have :

Code:

PS1='[\e[31m\u\e[0m:\w]: '
And root has:

Code:

export PS1='|\e[32m\e[1m\u\e[0m:\w|:'
My user name is red and root's name is green.


Go here for how to set up the PS1:

http://www.pantz.org/scripting/shell/colorterm.shtml

Have fun!

init_linux 09-08-2005 02:20 AM

Thank you Optimistic...It worked.


All times are GMT -5. The time now is 08:12 AM.