Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

On Linux (Fedora 14), the "w" command says this:

[USERNAME@PC ~] w
 23:51:32 up 13 min,  7 users,  load average: 0,22, 0,42, 0,34
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
USERNAME        tty1     :0               23:39   12:49  30.71s  0.08s pam: gdm-password
USERNAME        pts/1    :0.0             23:39    9:39   0.01s  0.01s bash
USERNAME        pts/0    :0.0             23:51    0.00s  0.02s  0.00s w
[USERNAME@PC ~] 

Why are there 7 logged in users when it only lists 3?

share|improve this question
    
Duh! I didn't even know about w, shame on me! –  phunehehe Dec 27 '11 at 12:06
    
This also applies to Ubuntu. –  Philip Dec 27 '11 at 12:36
    
Weird. Doesn't happen on RHEL 5.4 on a few boxes I looked at (including one rather busy and one completely idle server). –  Mat Dec 27 '11 at 16:46
1  
What does last|grep 'still logged in' say? –  Patrick Dec 27 '11 at 19:09
1  
Maybe you need to run it as root ? –  Dom Dec 27 '11 at 19:54
show 3 more comments

1 Answer

This answer to User logged in by sftp does not show up in `w` suggests that w uses utmp logging - some digging shows that utmp is a file in /var/run/utmp.

If a program hasn't cleaned up utmp after logging to it, I suspect w may produce output like what you ran into.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.