What is difference between /usr/sbin/ps & /usr/ucb/ps command
Solaris / OpenSolarisThis forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
/usr/bin/ps and /usr/ucb/ps are the same in that they are wrappers to call the platform specific ps (see /usr/bin/sparcv9/ps for example). /usr/ucb/ps should be the BSD ps /usr/sbin/ps should be the SVR4 ps. You can probably check this by examining their properties.
2) Solaris's "ps" is different, but the BSD ps (which is the same for some Linux, others are
Solaris-ish) is in /usr/ucb/ps. The command that is equivalent to /usr/usb/ps -axu is "ps -aef".
/usr/bin/ps and /usr/ucb/ps are the same in that they are wrappers to call the platform specific ps (see /usr/bin/sparcv9/ps for example). /usr/ucb/ps should be the BSD ps /usr/sbin/ps should be the SVR4 ps. You can probably check this by examining their properties.
You can invoke either one on UlrtraSPARC platforms (at least for the Solaris 8 and 9 that I have used them on). It is dependent on the path setting for your login session (if not including full path for "ls" command) - the default Solaris path uses /usr/bin, and omits /usr/ucb since that is a holdover from the "deprecated" SunOS 4 and earlier based on BSD unix prior to Sun's changeover to a unix based on AT&T's SvR4, which they then "marketed" as Solaris 2 (think they retro-named SunOS 4.x "Solaris 1" ;-). Since that name change, which went on up to 2.6, they dropped the "major" number, and designated only by the 'minor' number: 7, 8, 9, 10 - annoying to see Solaris "2.7", "2.9" by those oblivious to that change in nomenclature ;-).
More importantly, /usr/ucb/ps with "e" (and some other options, "xe"), can reveal all environment variables' settings for a process, and is supposed to be "turned off" by recent Solaris patches for 8 and 9 (10 is "unaffected") per this alert: http://sunsolve.sun.com/search/docum...=1-26-102215-1) as a security measure. Some env variable settings might include passwords, database connect strings, etc depending on approach used for that Id and the process it may be running.
1. SPARC processor-based machines (sun4m) can also run either ps in Solaris 9 (I believe) on down depending on path, not just the UltraSPARC (sun4u). It does seem that Solaris 10 is only for sun4u (and something newer?). (I need to upgrade my old Sparc LX from Sol 7 before my Sol 9 CD's go bad to have it to play with, although NetBSD should run faster in 196MB - maybe a dual boot ... ;-}
2. The options for the unpatched /usr/ucb/ps that are too "revealing" are -axe (I repeated the "e", and omitted the "a").
if you have ever wondered which executable is being run by a process (after looking at 'ps' o/p), '/usr/ucb/ps auxwww' comes to your aid. it shows you the exact command that invoked all the processes you see via 'ps'.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.