How to set the path for user root - Unix

This is a discussion on How to set the path for user root - Unix ; Hi, My problem is when I login as root, the search path is only /usr/sbin, /usr/bin. I have added other paths such as /usr/local/bin in the /.profile, /.cshrc, and /.login for root. But they do not work. If I want ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: How to set the path for user root

  1. How to set the path for user root

    Hi,

    My problem is when I login as root, the search path is only /usr/sbin,
    /usr/bin. I have added other paths such as /usr/local/bin in the /.profile,
    /.cshrc, and /.login for root. But they do not work. If I want to use the
    command saved at /usr/local/bin as root, I have to give the whole path or
    set the path again manually.

    Can someone let me know that how to set up the path environment variable for
    the user root? How the /usr/sbin, /usr/bin is set for root (I mean which
    file is used)? I checked /etc/profile, can't find anything.

    Thanks in advance.

    A new unix user.



  2. Re: How to set the path for user root

    On Wed, 18 May 2005 15:29:46 +0100, Unix user wrote:
    > Hi,
    >
    > My problem is when I login as root, the search path is only /usr/sbin,
    > /usr/bin. I have added other paths such as /usr/local/bin in the /.profile,
    > /.cshrc, and /.login for root. But they do not work. If I want to use the
    > command saved at /usr/local/bin as root, I have to give the whole path or
    > set the path again manually.


    Have you exported the PATH after setting it? What shell are you using?

    > Can someone let me know that how to set up the path environment variable for
    > the user root? How the /usr/sbin, /usr/bin is set for root (I mean which
    > file is used)? I checked /etc/profile, can't find anything.


    It depends on what shell, and possibly which OS you're using. A more
    detailed question will result in better answers.


  3. Re: How to set the path for user root

    The following is the output of set:
    --------------------------------------------------------------------
    Sun Microsystems Inc. SunOS 5.9 Generic May 2002
    cwd /
    home /
    path (/usr/sbin /usr/bin)
    user root
    ------------------------------------------------------------

    > Have you exported the PATH after setting it? What shell are you using?

    Yes I have exported the PATH. It is bourne share.

    "Dave Hinz" wrote in message
    news:3f123lF53fhpU7@individual.net...
    > On Wed, 18 May 2005 15:29:46 +0100, Unix user

    wrote:
    > > Hi,
    > >
    > > My problem is when I login as root, the search path is only /usr/sbin,
    > > /usr/bin. I have added other paths such as /usr/local/bin in the

    /.profile,
    > > /.cshrc, and /.login for root. But they do not work. If I want to use

    the
    > > command saved at /usr/local/bin as root, I have to give the whole path

    or
    > > set the path again manually.

    >
    > Have you exported the PATH after setting it? What shell are you using?
    >
    > > Can someone let me know that how to set up the path environment variable

    for
    > > the user root? How the /usr/sbin, /usr/bin is set for root (I mean which
    > > file is used)? I checked /etc/profile, can't find anything.

    >
    > It depends on what shell, and possibly which OS you're using. A more
    > detailed question will result in better answers.
    >




  4. Re: How to set the path for user root

    On Wed, 18 May 2005 16:22:30 +0100, Unix user wrote:
    > The following is the output of set:
    > --------------------------------------------------------------------
    > Sun Microsystems Inc. SunOS 5.9 Generic May 2002
    > cwd /
    > home /
    > path (/usr/sbin /usr/bin)
    > user root
    > ------------------------------------------------------------


    OK, but please don't top-post though, it screws up the flow of the
    conversation to have your answer before the question it answers.
    Especially in a technical group, that gets things really muddled fast
    if you do it that way, and people get grumpy about it.

    >> Have you exported the PATH after setting it? What shell are you using?


    > Yes I have exported the PATH. It is bourne share.


    and echo $PATH does, or doesn't show it? If it doesn't, then you either
    haven't set and exported it, or you're doing it wrong. What if you do
    it by hand in the shell, does it work as you'd expect?


  5. Re: How to set the path for user root

    In article , Unix user wrote:
    > The following is the output of set:
    > --------------------------------------------------------------------
    > Sun Microsystems Inc. SunOS 5.9 Generic May 2002
    > cwd /
    > home /
    > path (/usr/sbin /usr/bin)
    > user root
    > ------------------------------------------------------------
    >
    >> Have you exported the PATH after setting it? What shell are you using?

    > Yes I have exported the PATH. It is bourne share.
    >
    > "Dave Hinz" wrote in message
    > news:3f123lF53fhpU7@individual.net...
    >> On Wed, 18 May 2005 15:29:46 +0100, Unix user

    > wrote:
    >> > Hi,
    >> >
    >> > My problem is when I login as root, the search path is only /usr/sbin,
    >> > /usr/bin. I have added other paths such as /usr/local/bin in the

    > /.profile,
    >> > /.cshrc, and /.login for root. But they do not work. If I want to use

    > the
    >> > command saved at /usr/local/bin as root, I have to give the whole path

    > or
    >> > set the path again manually.

    >>
    >> Have you exported the PATH after setting it? What shell are you using?
    >>
    >> > Can someone let me know that how to set up the path environment variable

    > for
    >> > the user root? How the /usr/sbin, /usr/bin is set for root (I mean which
    >> > file is used)? I checked /etc/profile, can't find anything.

    >>
    >> It depends on what shell, and possibly which OS you're using. A more
    >> detailed question will result in better answers.


    Are you using a graphical login session (X Windows) such as CDE? If so, you may
    need to start new windows with the login shell option (usually '-ls') or add
    the path to your .dtprofile (if using CDE).

    Kevin

    --
    Unix Guy Consulting, LLC
    Unix and Linux Automation, Shell, Perl and CGI scripting
    http://www.unix-guy.com

+ Reply to Thread