Nikos Chantziaras wrote:
> I noticed that the root prompt does not include the full path of the
> current directory. Normal user:
>
> me@gentoopc ~ $ cd /usr/bin
> me@gentoopc /usr/bin $
>
> However, for root:
>
> gentoopc ~ # cd /usr/bin
> gentoopc bin #
>
> So for users, I can see where I am ("/usr/bin"). For root, I cannot.
> It just says "bin".
>
> Now, I can change it easily in /etc/bash/bashrc (not sure if that's
> the correct place, but it works) by replacing "\W" with "\w". However,
> I'm curious as to why "\W" is used for root. When I have several root
> logins open (and I usually have to,) it makes it difficult to tell
> where I am. It says "bin", but am I in /usr/bin, /usr/local/bin,
> somewhere else?
>
> Is there a rationale for this?
>
>
>
It's been a while but if I recall correctly, it's so that you can tell
the difference when you are logged in as root or a user. While a user
can do some damage, root can cause all sorts of havoc. On mine, so that
even a idiot can tell what user I'm logged in as, which includes the
current person sitting in my chair, mine says root@fireball and is in
red then shows the path as well. When I am logged in as a user, it says
<username>@fireball and then the path and is in green. If it is red, be
careful. If it is green, well, can't generally harm the OS itself, can
cause havoc for that user tho. So, it's so that you can tell when you
are a user or root easily. Of course, you could set them both to the
same and hope for the best. ;-)
I don't know if it still does but the install guide used to have a line
to set it to chroot <something> to indicate that it is a chroot. When
switching around a lot, that can come in handy. I got curious. It's
still there:
|export PS1="(chroot) $PS1"
Basically, it is set to help the person in the chair distinguish what is
root and what is not.
Dale
:-) :-)
|