command prompt

Frank Pineau frank at pineaus.com
Wed Nov 17 00:01:19 UTC 2004


On Tue, 16 Nov 2004 09:03:15 -0600, you wrote:

>If you just want your shell prompt to be what it used to be, issue 
>
>export PS1="[\u@\h \W]\$"
>
>PS1 is the prompt variable...
>


I put this one together a few years ago and I really like it.  It makes the
prompt red when you're root and green if you're a regular user.  Handy when
you're jumping back and forth.  Stick it at the end of /etc/bashrc

if [ `id -un` = root ]; then

PS1='\[\033[1;32m[\033[1;35m\]\u@\h\W\[\033[1;32m]\033[1;32m\]\$\[\033[1;0m\]'
 else

PS1='\[\033[1;32m[\033[1;36m\]\u@\h\W\[\033[1;32m]\033[1;32m\]\$\[\033[1;0m\]'
fi


Home dir prompt will look like this: 

[fpineau at snafu ~]$   

(plus color, of course)




More information about the fedora-list mailing list