LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 08-10-2009, 02:59 PM   #1
brian4xp
LQ Newbie
 
Registered: Feb 2008
Posts: 7

Rep: Reputation: 0
"w" command user count


Where does the "w" command get it's user count from?

I've seen it match the number of users listed and I've also seen it higher than the number of users listed, so it's apparently counting user processses that it isn't listing at times.

Right now I checked a Redhat 7.1 (not Fedora, Redhat) system where the w gave the exact number of users it listed, a Fedora 10 system where the count was 1 more than the users listed, and another Fedora system where the count was 11 more than it listed.

Can anyone tell me what is going on?
 
Old 08-10-2009, 07:29 PM   #2
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
See `man w` -- under files -- /var/run/utmp - information about who is currently logged on.

Your explanation of differences is insufficiently clear. What do you mean by "number of users listed" as opposed to "its user count"? Are you noting multiple sessions where the same user has logged in more than once?
 
Old 08-11-2009, 08:11 AM   #3
brian4xp
LQ Newbie
 
Registered: Feb 2008
Posts: 7

Original Poster
Rep: Reputation: 0
I mean this:

Code:
[root@server0 ~]# w
 09:06:06 up 13 days,  2:05, 21 users,  load average: 0.00, 0.00, 0.00
USER     TTY      FROM              LOGIN@   IDLE   JCPU   PCPU WHAT
user01   ttyD009  -                29Jul09  4days  0.01s  0.00s -bash
root     pts/5    192.168.1.10     09:06    0.00s  0.03s  0.00s w
user01   ttyD008  -                07:14    1:13m  0.27s  0.01s -bash
user02   pts/1    192.168.1.5      07:18    2:30   5.83s  0.01s -bash
user03   pts/0    192.168.1.3      07:27   22.00s  1.56s  0.00s -bash
user04   pts/2    192.168.1.14     07:51    1.00s  1.13s  0.01s -bash
user05   pts/3    192.168.1.4      08:03    1.00s  0.52s  0.01s -bash
user06   pts/4    192.168.1.2      08:05   24.00s  1.70s  0.01s -bash
It says 21 users (user count) but only lists 8 (one user is logged on twice)

Last edited by brian4xp; 08-11-2009 at 08:13 AM. Reason: clarification
 
Old 08-12-2009, 05:49 PM   #4
choogendyk
Senior Member
 
Registered: Aug 2007
Location: Massachusetts, USA
Distribution: Solaris 9 & 10, Mac OS X, Ubuntu Server
Posts: 1,197

Rep: Reputation: 105Reputation: 105
It's gotta be something to do with background processes or something. I have looked at my systems and none of them show a discrepancy. But we typically don't have many users using shell sessions. Basically just the sysadmins. Have you compared who, whodo, ps, and other things?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
unable download the file through "put" command for anonymous user roni_atx Linux - General 3 11-20-2008 03:15 AM
Standard commands give "-bash: open: command not found" even in "su -" and "su root" mibo12 Linux - General 4 11-11-2007 10:18 PM
script to count the mails in an users folder "/var/spool/mail/user" sharad Linux - Software 1 03-16-2006 10:58 PM
how to log user commands in xterm without using "script" command lilachb Linux - General 2 08-28-2005 01:08 AM
User Login Problem: "command not found" unless root! DreameR-X Linux - General 15 12-21-2004 11:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:57 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration