1

so, pretty much, i was going about my server business as usual, when my SSH/bash terminal(PuTTY) decided to stop responding during a grep command. ^C wasn't letting me cancel out the job, so after a while i closed the terminal and logged back in as root, typed in 'users' and 'who' which showed one user. so i logged out, then back in as my normal user, ran 'top', and there it said 2 users.

i jumped out of top, punched 'w' and hit enter, and there it was. 2 users, but listed only 1.

pretty noob, i know. any help would be much appreciated.

4
  • what does "listed only 1" mean? Also, if you leave a session hanging, it will still be counted, best to close it off "ps -ef | grep username" should show you what they are/were doing, then kill PID to close.
    – Grizly
    Jun 25, 2010 at 4:35
  • I think the OP is referring to the single line output of procps's print_uptime() (used by uptime, w and top), which gives a numeric count of users, being greater than the per-line output which follows from w.
    – Dan Carley
    Jun 25, 2010 at 9:10
  • "listed only 1" meant that after issuing 'w', it said 2 users(after uptime, and before load average), but in the table below it only listed the 1 user(my current user). ah, good man! i assume the results with the '?' are the little buggers to be dealt with?
    – Edgar beatlebe
    Jun 25, 2010 at 9:20
  • ah ... well, i killed the processes notated with '?' but that didn't change the user count, instead killed my ssh and didn't let me back in. hmm, no ssh. so, i ended up restarting my server, which of course fixed everything, but not in the way i would have preferred. not much of a sysadmin now am i? would've still liked to have known what went wrong though
    – Edgar beatlebe
    Jun 25, 2010 at 9:30

1 Answer 1

1

If you're logged in more than once under the same user name, top, w and others will count each of those logins as "users" even though they represent only one account.

When you closed the terminal without logging out, it takes a while for the system to recognize that. So until it clears it out you're counted as being logged in multiple times. If you do the w command it will display multiple lines for your account.

1
  • but shouldn't it still list the user when i call 'w' as another user, such as root?
    – Edgar beatlebe
    Jun 25, 2010 at 8:52

You must log in to answer this question.