2

I am using Mac OS X Snow Leopard 10.6.8.

My Mac has several volumes with OS X and each volume has several users.

I wish to minimise the work required to ensure that my paths are adequate both for the installed OS and subsequent non-Apple additions by updating /private/etc/paths.

Is there a way to determine where executables requiring a path reside or should reside?

Is it practical to move items to a directory in the path?

My /private/etc/paths contains:

/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin

echo $PATH produces:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

However the above are not adequate for some applications.

A search for directories named sbin produces many hits including:

/usr/local/sbin

Should the various share directories be in the path?

Searching for directories containing executables with the following find command produces over 8,000 hits and is clearly not a viable approach.

find / -perm +0111 -type d
  • It depends on the apps you want to use - work that out first then decide on your path. Note that the onl;y path you can copy to in the ones above is /usr/local/bin. Executables in .../sbin tend to be special and probably require than a normal user's permissions so do you want all people to see them? – Mark Jul 3 '18 at 13:20
  • This is not practical. Installers do not always say which paths need setting. As far as I can tell there is nothing to stop any admin installing in one of the several sbin directories. – Neville Hillyer Jul 3 '18 at 13:58
  • How can I turn on instant email notification here? – Neville Hillyer Jul 3 '18 at 13:59
  • Installers do not always say which paths need setting. No. What they should be doing is creating a symlink to /usr/local/bin. – Allan Jul 3 '18 at 14:58
  • 1
    Installers should do as the admin requires - if they don't then you have to ask what else they do wrong. Unix command line tools use install that defaults to /usr/local and it is up to the admin to override that if they want. – Mark Jul 4 '18 at 15:55
1

When you login to your computer the loginwindow.app creates environment with the PATH variable set to:

/usr/bin:/bin:/usr/sbin:/sbin

This PATH is available to all applications that you start. When you start the Terminal.app this PATH is inherited by your shell which is started as a login shell. The PATH is then processed by the path_helper application to produce the PATH:

/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

The system is designed for an application package or an administrator to add paths by creating text files with adsolute paths in the directory /private/etc/paths.d. You may find other executables located in

/private/etc
/usr/lib
/usr/libexec
/usr/local # should have the same hierarchy as /usr
/opt
/opt/local # macports package manager
/sw # fink package manager
/System
/Library

Tools may also be found in bundles and frameworks.

/Applications/LibreOffice.app/Contents/MacOS # the path to run open office headless
/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources # the path to the commandline airport utility 

There are no set rules and an administrator could design his/her own prefix to install software.

The goal of an administrator is to set the global path as small as possible then expand the path as needed according to a user's privileges, in their own startup files.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .