Very often, if you work with multiple servers within your organization, you might want to see who else is connected to the server, for some reason.
On Windows, use this command:
query user
On Linux, use this command:
who
If you want to kick that user out, by closing his session, you can. But be sure to send him/her a message first, in order to avoid him/her losing his/her work:
On Windows, use this command:
msg [sessionID]
On Linux, use this command:
write [username] [terminal] "your message" following by CTRL+D
If it is a go, then use the following command on Windows:
logoff [sessionID]
On Linux, use this one:
pkill -9 -u [username]