Professional Web Applications Themes

How to set the path for user root - Linux / Unix Administration

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. ...

  1. #1

    Default 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.


    Unix Guest

  2. #2

    Default Re: How to set the path for user root

    On Wed, 18 May 2005 15:29:46 +0100, Unix user <com> wrote: 

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

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

    Dave Guest

  3. #3

    Default 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
    ------------------------------------------------------------
     
    Yes I have exported the PATH. It is bourne share.

    "Dave Hinz" <net> wrote in message
    news:net... 
    wrote: [/ref]
    /.profile, [/ref]
    the [/ref]
    or 
    >
    > Have you exported the PATH after setting it? What shell are you using?
    > [/ref]
    for 
    >
    > It depends on what shell, and possibly which OS you're using. A more
    > detailed question will result in better answers.
    >[/ref]


    Unix Guest

  4. #4

    Default Re: How to set the path for user root

    On Wed, 18 May 2005 16:22:30 +0100, Unix user <com> wrote: 

    OK, but please don't top-post though, it s 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.
     [/ref]
     

    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?

    Dave Guest

  5. #5

    Default Re: How to set the path for user root

    In article <d6fmma$2o1$ox.ac.uk>, Unix user wrote: 
    > Yes I have exported the PATH. It is bourne share.
    >
    > "Dave Hinz" <net> wrote in message
    > news:net... 
    > wrote: [/ref]
    > /.profile, [/ref]
    > the [/ref]
    > or 
    >>
    >> Have you exported the PATH after setting it? What shell are you using?
    >> [/ref]
    > for 
    >>
    >> It depends on what shell, and possibly which OS you're using. A more
    >> detailed question will result in better answers.[/ref][/ref]

    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
    Kevin Guest

  6. #6

    Default Re: How to set the path for user root

    On Wed, 18 May 2005 16:22:30 +0100, Unix user
    <com> wrote: 
    > Yes I have exported the PATH. It is bourne share.
    >[/ref]
    That doesn't look like the output of a Bourne shell "set" command.


    --
    Test-tube babies shouldn't throw stones.
    Bill Guest

Similar Threads

  1. Path - Site Root vs. Doent Relative
    By voxmaris in forum Macromedia Dynamic HTML
    Replies: 1
    Last Post: August 8th, 10:31 PM
  2. Determining FTP root folder from path?
    By jerrygarciuh in forum PHP Development
    Replies: 3
    Last Post: November 5th, 07:28 PM
  3. Where does PATH get set for root user?
    By Anthony in forum Linux Setup, Configuration & Administration
    Replies: 66
    Last Post: October 24th, 06:55 AM
  4. Replies: 4
    Last Post: September 22nd, 03:28 AM
  5. Updating Path information for ROOT
    By Daryl in forum Sun Solaris
    Replies: 4
    Last Post: August 12th, 01:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139