- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: CMD field in ps output
Operating System - HP-UX
1752580
Members
3474
Online
108788
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-01-2008 11:26 PM
тАО10-01-2008 11:26 PM
CMD field in ps output
Hi
I need some explanation on the CMD field of ps command output.
As su(1) shows, if su is used and ONLY if the shell of the new user is /usr/bin/sh, the parameter 0 in the new shell is set to "su".
I checked that it is true but ps command shows "su" ONLY if "-f" option is used:
$ ps -p 5398; ps -p 5398 -f
PID TTY TIME COMMAND
5398 pts/1 0:00 sh
UID PID PPID C STIME TTY TIME COMMAND
monuser 5398 5381 0 09:03:34 pts/1 0:00 su
IF XPG4 format is used, "su" is always displayed:
$ UNIX95= ps -p 5398; UNIX95= ps -p 5398 -f
PID TTY TIME CMD
5398 pts/1 00:00 su
UID PID PPID C STIME TTY TIME CMD
monuser 5398 5381 0 09:03:34 pts/1 00:00 su
I didn't find a reason for this behaviour in ps(1) man pages.
Does anyone know why?
I need some explanation on the CMD field of ps command output.
As su(1) shows, if su is used and ONLY if the shell of the new user is /usr/bin/sh, the parameter 0 in the new shell is set to "su".
I checked that it is true but ps command shows "su" ONLY if "-f" option is used:
$ ps -p 5398; ps -p 5398 -f
PID TTY TIME COMMAND
5398 pts/1 0:00 sh
UID PID PPID C STIME TTY TIME COMMAND
monuser 5398 5381 0 09:03:34 pts/1 0:00 su
IF XPG4 format is used, "su" is always displayed:
$ UNIX95= ps -p 5398; UNIX95= ps -p 5398 -f
PID TTY TIME CMD
5398 pts/1 00:00 su
UID PID PPID C STIME TTY TIME CMD
monuser 5398 5381 0 09:03:34 pts/1 00:00 su
I didn't find a reason for this behaviour in ps(1) man pages.
Does anyone know why?
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-02-2008 12:15 AM
тАО10-02-2008 12:15 AM
Re: CMD field in ps output
Its certainly not that clear from the man page, but all I can surmise (guess at!) is that
- the default beahviour of ps is to show the command if no options are specified and to show arguments if "-f" is specified
- the default beahviour of ps in UNIX95 standard mode is to show the show arguments regardless of whether "-f" is specified.
You can see an interesting comparison by running:
UNIX95= ps -eo pid,comm,args
HTH
Duncan
I am an HPE Employee
- the default beahviour of ps is to show the command if no options are specified and to show arguments if "-f" is specified
- the default beahviour of ps in UNIX95 standard mode is to show the show arguments regardless of whether "-f" is specified.
You can see an interesting comparison by running:
UNIX95= ps -eo pid,comm,args
HTH
Duncan
I am an HPE Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-02-2008 12:42 AM
тАО10-02-2008 12:42 AM
Re: CMD field in ps output
This seems to be a bug? in ps(1) and unrelated to su. It has to do with processes that exec and don't fork.
Basically su is no longer there, only sh.
Basically su is no longer there, only sh.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP