Understanding the "who" command

Brad De Vries devriesbj
Fri Aug 4 11:10:19 PDT 2006


Hey all, I'm hoping that someone can give me a little insight into
where the data comes from for the "who" command.  Here's what I'm
seeing on my box right now:

---------
/home/bjd> who
bjd      pts/0        Aug  4 13:55 (qad-gr)
bjd      pts/2        May 30 15:53
/home/bjd> ps -ft pts/2
ps: error: TTY could not be found.
usage: ps -[Unix98 options]
       ps [BSD-style options]
       ps --[GNU-style long options]
       ps --help for a command summary
/home/bjd> ps -ef | grep bjd
bjd       1729  1727  0 13:55 ?        00:00:00 /usr/sbin/sshd
bjd       1731  1729  0 13:55 pts/0    00:00:00 -bash
bjd       1774  1731  0 13:56 pts/0    00:00:00 ps -ef
bjd       1775  1731  0 13:56 pts/0    00:00:00 grep bjd
/home/bjd> w
 14:07:54  up 332 days,  3:45,  2 users,  load average: 0.01, 0.02, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU  WHAT
bjd      pts/0    qad-gr            1:55pm  0.00s  0.07s  0.01s  w
---------

You can clearly see that the "who" command shows two users but the
"ps" and "w" commands only shows processes attached to one.

I could reboot the server but I'm hoping to achieve a full year of uptime.

Thanks,
Brad.



More information about the Linux-users mailing list