ps command gives only userid for certain users, not username
This is driving me crazy. I've added two users today with "useradd -m <username>". All processes for the first user I added show up in "ps -elf" with the userid listed instead of the username. Processes for the second user show up as I would expect: with the username.
For the problematic user, when I do ps -eo "%u", the list includes the username but doing ps -eo "%u %c" causes it to display the userid with the command. The entries in /etc/passwd and /etc/shadow seem right. |
On my various boxes the full text field selectors seem the most reliable, e.g.:
Code:
> ps -eo "ruid ruser cpu %cpu" |
How does
Code:
ps aux |
Actually, the 'ps -eo "ruid ruser cpu %cpu" ' command still gives me just the uid #, like this:
[root@zen init.d]# ps -eo "ruid ruser cpu %cpu" RUID RUSER CPU %CPU 25 named - 0.0 0 root - 0.0 0 root - 0.0 32 rpc - 0.0 29 rpcuser - 0.0 99 nobody - 0.0 0 root - 0.0 0 root - 0.0 0 root - 0.0 0 root - 0.0 27 mysql - 0.0 0 root - 0.0 51 smmsp - 0.0 0 root - 0.0 0 root - 0.0 0 root - 0.0 48 apache - 0.0 48 apache - 0.0 48 apache - 0.0 48 apache - 0.0 48 apache - 0.0 48 apache - 0.0 48 apache - 0.0 48 apache - 0.0 43 xfs - 0.0 0 root - 0.0 0 root - 0.0 81 dbus - 0.0 42 gdm - 0.0 0 root - 0.0 501 501 - 0.1 501 501 - 0.0 501 501 - 0.0 501 501 - 0.0 501 501 - 0.0 501 501 - 0.0 501 501 - 0.0 501 501 - 0.0 501 501 - 0.0 0 root - 0.0 (edited slightly to pull most root entries for easier reading). The "ps aux" command gives the uid as well. |
All times are GMT -5. The time now is 04:39 PM. |