LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How to check amount of users logged in (https://www.linuxquestions.org/questions/linux-general-1/how-to-check-amount-of-users-logged-in-83988/)

CurtisKaj 08-20-2003 07:19 PM

How to check amount of users logged in
 
Hey guys,

I work at a help desk and whenever I log onto one of our servers and wish to restart the server or software or something I need to make sure no one else is on. So right now I go around the office asking people to make sure, slow eh? ya. So is there a command I can run which will tell me if there is anyone currently logged on to the same server as me? and also is there a command I can do to broadcast a message to everyone logged on like "I'm restarting the software now."

If anyone knows that would be great, thanks!

:newbie:

darthtux 08-20-2003 07:43 PM

who shows you who is logged in

shutdown has options to restart the server in a certain amount of time and append a warning message.
http://www.linuxvalley.it/encycloped...shutdown.8.php

lyle_s 08-20-2003 08:19 PM

In addition to who(1) there's w(1); it's a bit shorter to type and gives more information. last(1) also comes to mind.

You can use write(1) to write a message to another person's terminal. Maybe you could write a script that takes the first column of who(1) and uses write(1) to broadcast a message?

Lyle

CurtisKaj 08-20-2003 08:41 PM

Thanks darthtux!

That helps alot :)

CurtisKaj 08-20-2003 09:46 PM

and Thanks lyle thats sweet as well :P


All times are GMT -5. The time now is 11:53 AM.