who is logged in, what they are doing (2024)


The w command shows who is logged in to the system and what they are doing.

A login, logging in or logging on is the entering of identifier information into a system by a user in order to access that system (e.g., a computer or a website). It generally requires the user to enter two pieces of information, first a user name and then a password.

The basic syntax of w is:

w [options] [username1, username2, . . .]

The square brackets indicated that the enclosed items are optional. When used without any options, w sends to standard output (which is by default the display screen) a header line followed by a table that contains a line of data for each user currently logged in.

The header shows six items: the current time, how long the system has been running (in minutes) since it was booted up (i.e., started up), how many users are currently logged on, and the system load averages, i.e., the average number of processes active, during the last one, five and 15 minutes. A process is an executing (i.e., running) instance of a program.

The main part of w's output consists of a table showing eight items of information for each user currently logged into the system. The eight columns are labeled USER, TTY, FROM, LOGIN@, IDLE, JCPU, PCPU and WHAT.

USER is the login name of the user. TTY (which now stands for terminal type but originally stood for teletype) is the name of the console or terminal (i.e., combination of monitor and keyboard) that the user logged into, which can also be found by using the tty command. Every time a user logs in across the network, a new tty is assigned to that user.

The consoles can be real or virtual. A feature of Linux systems is the use of virtual consoles, which act as independent logical consoles that run in separate login sessions, but which are accessed from the same physical console (i.e., the same keyboard and screen). That is, each virtual console can have a different, or the same, user logged into it. On a Red Hat system, seven virtual consoles are configured and active by default.

FROM is the remote host (i.e., the name of some other computer), if any, that the user logged into. LOGIN@ is the time at which the user logged in. IDLE is the number of hours and minutes since the user last typed anything at the keyboard.

JCPU is the number of minutes accumulated by all processes attached to the tty. It does not include past background processes (i.e., low priority processes that operate only in gaps between higher priority foreground processes), but it does include currently running background processes.

PCPU is the time consumed by the current process, named in the WHAT column. WHAT lists the name of the current process along with any options and arguments (i.e., input files) used with the command that launched it.

Among the more useful of w's few options is -h, which tells it to omit the header header line from its output. The -s option tells it to use the short format, which omits the login time, JCPU and PCPU columns. The -l option creates a long listing, which is the same as the default. The -V option displays the version number of the currently installed w program.

By default, w reports on all users. However, it can be made to report on only a specified set of users by providing those usernames in a comma-separated list.

w provides information similar to that which would be provided by a combination of the uptime, who and ps -a commands. uptime produces a single line of output that is the same as w's header line. who shows who is currently logged into the system. ps -a lists all processes with a tty except session leaders (i.e., processes that created sessions).

w can be useful, but there are some faults with the information it provides, and thus its output should only be considered approximate. In particular, the notion of the current process is unclear and there are some problems detecting background processes, even though they usually account for much of the load on the system. Also, the CPU time is only an estimate; for example, if a user leaves a background process running after logging out, the time is credited to the person currently on that terminal.

w shows information only for those users who have logged in through a console (i.e., a full-screen text-only display) or a graphical user interface (GUI) login window, and it does not show data for users who have logged in through a terminal window (i.e., a window in a GUI that emulates a console).

w is part of the procps package, which contains several small utilities that provide information about processes using the /proc filesystem. The package also includes the free, kill, ps, skill, slabtop, top and vmstat programs.

________
The home page of procps is http://procps.sourceforge.net/

Created May 9, 2005.
Copyright © 2005 The Linux Information Project. All Rights Reserved.

who is logged in, what they are doing (2024)

FAQs

What users are logged in? ›

Press the Windows Key + X, and click on Task Manager. Click on the Users tab. Any signed-in users will be listed there. Right-click on any user name to disconnect that user.

How to check who logged into the server? ›

To find out the details, you have to use Windows Event Viewer. Follow the below steps to view logon audit events: Go to Start ➔ Type “Event Viewer” and click enter to open the “Event Viewer” window. In the left navigation pane of “Event Viewer”, open “Security” logs in “Windows Logs”.

Who is logged into a computer? ›

Step 1: Open Event Viewer (search for it in the Start menu or taskbar search). Step 2: Then, navigate through the tree structure on the left panel to Windows Logs > Security. Step 3: Next, look for events with Event ID 4624. This specific event message indicates "An account was successfully logged on."

How to check who is logged into a server remotely? ›

In Server Manager, click Tools, and then click Remote Access Management. Click REPORTING to navigate to Remote Access Reporting in the Remote Access Management Console. Click Remote Client Status to navigate to the remote client activity and status user interface in the Remote Access Management Console.

How can I see who logged into my account? ›

Go to your Google Account. On the left navigation panel, select Security . On the Your devices panel, select Manage all devices. You'll see devices where you're currently signed in to your Google Account or have been in the last few weeks.

How do I find out how many users are logged in? ›

Commands to get user-related information:
  1. id Command to Find How Many Users are Logged In. ...
  2. groups Command. ...
  3. getent Command. ...
  4. lslogins Command to Find How Many Users are Logged In. ...
  5. users Command to Print Current Logged-in User. ...
  6. who Command to Display who logged In. ...
  7. w Command to Show the Logged In User. ...
  8. last or lastb Command.
Feb 6, 2024

Who is currently logged in to this server? ›

How to see who is logged in. Run the who command from the command prompt. This will list anyone who is currently logged in.

Who has access to my server? ›

The easiest way to determine who has access to a particular Windows machine is to go into computer management (compmgmt. msc) and look in Local Users and Groups. Check the Administrators group and the Remote Desktop Users group to see who belongs to these.

How do I track user activity on my server? ›

Track User Activity in Windows Computers using Event Logs
  1. Enable Audit Policy. Select Server Manager on Windows server. ...
  2. Enable logon-logoff. Go back to Computer Configuration. ...
  3. Use Active Directory Event Viewer to check the logs. Open Event Viewer and navigate to Windows logs, Security.
Jun 23, 2023

Can someone see what I am doing on my computer? ›

Spyware can keep track of every keystroke you type, every software application you use, every website you visit, every chat or instant message you send, every document you open, and everything you print. Some spyware software gives the person monitoring the ability to freeze, shutdown or restart your computer.

Can you tell if someone is accessing your computer? ›

Check the recent activity on your computer: Look for anything you don't recognize -- recently accessed files, login events, browser history, and system logs. Review installed programs: Look for remote access programs you didn't install. Some of the most common apps include LogMeIn and TeamViewer.

Which command is used to know who is logged into the computer? ›

The who command displays information about all users currently on the local system. The following information is displayed: login name, tty, date and time of login. Typing who am i or who am I displays your login name, tty, date and time you logged in.

How do I see who is connected to my remote desktop? ›

Expand “Local Users and Groups” and click to access the “Groups” list. Here, you should find all the information you need. In the group “Remote Desktop Users”, those users listed will have been allocated access privileges.

How do you know who your server is? ›

Step 1: Use the device search function to open the command prompt. Step 2: Type 'nslookup domain.com' (without using quotation marks and where domain is your domain) into the command prompt, then click enter. This will display the server's network settings.

How to display a list of users currently logged on to system? ›

To display information about all users currently logged into the local system, use the who command. The following information is displayed: login name, system name, and date and time of login. Note: This command only identifies logged-in users on the local node.

Which users are logged in SAP? ›

Please note that the transaction code SM04 will show the list of the users which are logged on only to the instance in which you are currently logged in. To view details of users for all instances, check transaction AL08, however, you cannot do much other than viewing the details.

How do I see where an ad user is logged in? ›

Active Directory auditing stores user logon history details in event logs on domain controllers. Therefore, the most straightforward option to get user logons is to filter out all Security events in the Windows Event Viewer and find the target user account and logon type.

Top Articles
Latest Posts
Article information

Author: Lakeisha Bayer VM

Last Updated:

Views: 6113

Rating: 4.9 / 5 (49 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Lakeisha Bayer VM

Birthday: 1997-10-17

Address: Suite 835 34136 Adrian Mountains, Floydton, UT 81036

Phone: +3571527672278

Job: Manufacturing Agent

Hobby: Skimboarding, Photography, Roller skating, Knife making, Paintball, Embroidery, Gunsmithing

Introduction: My name is Lakeisha Bayer VM, I am a brainy, kind, enchanting, healthy, lovely, clean, witty person who loves writing and wants to share my knowledge and understanding with you.