RedHatPsUid

Red Hat ps displays UID instead of full name

Very common problem, apparently, but one that I just bumped into...

You get this on some Red Hat (and Centos) machines:

54326    12187  0.0  0.0  90156  1856 ?        S    09:55   0:00  |   \_ sshd: dcherruaud@notty
root     12469  0.0  0.0  90156  3332 ?        Ss   10:30   0:00  \_ sshd: dcherruaud [priv]
54326    12471  0.0  0.0  90156  1760 ?        S    10:30   0:00  |   \_ sshd: dcherruaud@notty
root     12766  0.0  0.0  90156  3292 ?        Ss   10:54   0:00  \_ sshd: dborcard [priv]
dborcard 12768  0.0  0.0  90156  1724 ?        S    10:54   0:00  |   \_ sshd: dborcard@pts/4
dborcard 12769  0.0  0.0  68152  1564 pts/4    Ss+  10:54   0:00  |       \_ -bash
root     13070  0.0  0.0  90156  3392 ?        Ss   11:00   0:00  \_ sshd: root@notty
root     13278  0.0  0.0  90156  3296 ?        Ss   11:10   0:00  \_ sshd: pcausse [priv]
pcausse  13280  0.0  0.0  90156  1732 ?        S    11:10   0:00  |   \_ sshd: pcausse@pts/8
pcausse  13281  0.0  0.0  68152  1596 pts/8    Ss+  11:10   0:00  |       \_ -bash

Hmmm... How come some users have their names in the ps output (like dborcard for instance), while others only have their GID (see 54326 above)?

The answer is in the FAQ:

procps FAQ:

Why do long usernames get printed as numbers?

The UNIX and POSIX standards require that user names and group names be printed
as decimal integers when there is not enough room in the column. Truncating the
names, besides being a violation of the standard, would lead to confusion
between names like MichelleRichards and MichelleRichardson. The UNIX and POSIX
way to change column width is to rename the column:

     ps -o pid,user=CumbersomeUserNames -o comm

The easy way is to directly specify the desired width:

     ps -o pid,user:19,comm
               ^^^^^^^

You have to use: ps -eo user:20,group,pid,args

And there is your answer!

See Also:

These two pages gave me the answer shown above: