Top link
Simplified user interface to the Virtual Exam environment
Simplified user interface to the Virtual Exam environment

VirtualExam (vx)
Gotchas: oddnesses, weirdnesses and other things strange

The ps command

For no obvious reason, ps sometimes displays numbers instead of names. For example, displaying the UID instead of the user name like the last three lines here:

# ps -eo euser,comm
EUSER    COMMAND
...
gdm      gdmgreeter
root     book_manager 
root     saf_daemon
root     inetd
root     kworker/2:2
root     sshd
35469    sshd
35469    bash
35469    checkmail

There is actually a reason for this. ps allocates a default width for each column (depends on the column title width or whether it's the last or right-most column). If it needs to output something which is wider than the predetermined width and the something also has a numerical value (such as user name), then it displays the number instead.

To overcome this, you need to somehow specify a larger column width for the offending column. You can do it, as hinted above, by increasing the column title size. You can also do it like this, explicitly stating the desired column width:

# ps -eo euser:20,comm      
EUSER                COMMAND
...
gdm                  gdmgreeter
root                 book_manager 
root                 saf_daemon
root                 inetd
root                 kworker/2:2
root                 sshd
virtualexam          sshd
virtualexam          bash
virtualexam          checkmail