Results 1 to 3 of 3

Thread: Logic of default $PATH's in Ubuntu

  1. #1
    Join Date
    Nov 2008
    Beans
    29

    Logic of default $PATH's in Ubuntu

    Hello all,
    Just curious if there is an interesting reason why the default paths selected in Ubuntu are selected? My appears as:

    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games

    but I have been working on a redhat machine or two at work and noticed it is quite different. It will have directories such as /bin/ and /sbin/ etc..... I assume this is probably because these directories are intented for Root. If that is so, the confusing aspect is that if I run ifconfig which is located in /sbin/ifconfig, the binary is found without specifying the directory. How can that be if it is not in my PATH?

    Cheers

  2. #2
    Join Date
    Nov 2008
    Location
    Boston MetroWest
    Beans
    16,326

    Re: Logic of default $PATH's in Ubuntu

    It is in your path. Each of the directories is searched in order from left to right until a matching binary name is found. The /usr/local entries are at the beginning since self-compiled software is typically installed to /usr/local/bin. Presumably you would want your version of a program to be run in favor of the official version in the repository. For example, my /usr/local/bin contains self-compiled versions of mplayer and ffmpeg, so if I type "mplayer" at the prompt I get /usr/local/bin/mplayer, not /usr/bin/mplayer.
    If you ask for help, do not abandon your request. Please have the courtesy to check for responses and thank the people who helped you.

    Blog · Linode System Administration Guides · Android Apps for Ubuntu Users

  3. #3
    Join Date
    Nov 2008
    Beans
    29

    Re: Logic of default $PATH's in Ubuntu

    Woops! Yeah, I missed that, it is in the path....

    Thanks for the reply. I will now go get my eyes tested

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
  •