Can username col be enlarged in ps output

Principally concerned with RedHat Linux (EL3+).

When using a ps command that includes the username in the output line is there a way to enlarge the size of the column.

It appears that presently that column is limited to 8 characters and if an id is larger than that the uid is used. That makes lookups etc. somewhat more awkward and plays havoc with scripts that need to do things based upon extracting a username from a ps line.

Is there some way to increase the size of ps' username output?

Thx.
G. Salisbury
Long Valley, NJ

I thought that officially, user names were limited to 8 characters long in distinction. That is, you can have a name longer than that, but comparisons will stop after 8 characters. I'm not totally sure, though.

In Linux, the ps command is highly versatile. You can do something like "ps -o uid,cmd" just to output those two field. Check the man page for all the gory details of the -o option. Moreover, you can get the uid directly from the /proc filesystem if you know the PID. Look at the directory /proc/$$. You'll find the uid hiding in plain sight or in the "stat" output (which is cryptic) or in the owner of the directory itself.