Operating System - HP-UX
1832456 Members
3115 Online
110043 Solutions
New Discussion

Re: Quick question: /sbin/usr vs. /usr/bin/sh

 
SOLVED
Go to solution
Jim Tropiano_1
Frequent Advisor

Quick question: /sbin/usr vs. /usr/bin/sh

What are or where can I get the differences between /sbin/sh and /usr/bin/sh.
WHich is better to give developers and why?
7 REPLIES 7
Robert-Jan Goossens_1
Honored Contributor

Re: Quick question: /sbin/usr vs. /usr/bin/sh

/usr/sbin/sh

root uses /sbin/sh because /usr is not mounted in single user mode.

Regards,
Robert-Jan
Pete Randall
Outstanding Contributor
Solution

Re: Quick question: /sbin/usr vs. /usr/bin/sh

The version of sh in /sbin is statically linked (it does not use shared libraries) and is there solely for root's use when the system in in single user mode and /usr is not mounted.

Your developers should be using /usr/bin/sh.


Pete

Pete
Marvin Strong
Honored Contributor

Re: Quick question: /sbin/usr vs. /usr/bin/sh


/sbin/sh is staticly linked and therefore self contained.

/usr/bin/sh is dynamically linked and relies upon shared libraries.

developers should be fine with /usr/bin/sh.

Patrick Wallek
Honored Contributor

Re: Quick question: /sbin/usr vs. /usr/bin/sh

/sbin/sh and /usr/bin/sh provide the same functionality.

The major difference is that /sbin/sh is a statically linked file, which means that it does not need any of the libraries in /usr/lib. /usr/bin/sh requires that the libraries in /usr/lib be available for it to use.

The same is true for all executable in /sbin/. They are all statically linked so that they can be used by the system before /usr is mounted.

I would stick with /usr/bin/ for the developers.
A. Clay Stephenson
Acclaimed Contributor

Re: Quick question: /sbin/usr vs. /usr/bin/sh

The standard shell -- and should be the shell for all users except root -- is /usr/bin/sh. Surprisingly, /usr/bin/sh and /sbin/sh are actually the same shell, POSIX with one important difference. The version is /sbin/sh is statically linked so that, for example, the shell commands to mount filesystems can be run before the shared libraries in /usr (which ain't mounted yet) are available.

Because the /usr/bin/sh versions uses shared libraries (dynamically linked) and is thus more memory efficient, it should be the "standard" shell in all other cases.
If it ain't broke, I can fix that.
Jim Tropiano_1
Frequent Advisor

Re: Quick question: /sbin/usr vs. /usr/bin/sh

Thank You for the information.
Jim Tropiano_1
Frequent Advisor

Re: Quick question: /sbin/usr vs. /usr/bin/sh

Thank YOU!!!