- w command : Show who is logged on and what they are doing on Linux
- who command : Display information about Linux users who are currently logged in
- whoami command : Find out who you are currently logged in as on Linux
- id command : See user and group information for the specified USER account on Linux
How to show current logged in users in Linux
Open the terminal window and type:w
The w command shows information about the Linux users currently on the server, and their running processes. The first line displays, in this order:
- The current time ( 22:11:17 )
- How long the Linux server has been running (18 days)
- How many users are currently logged on Linux (2 users)
- The system load averages for the past 1, 5, and 15 minutes (1.01, 1.04, 1.05)
The following info displayed for each current logged in user:
sweta pts/10 minitx 22:11 5.00s 0.04s 0.02s vim replicant.py
Where,
- sweta – Login name
- pts/10 – The tty name
- minitx – The remote host/desktop/laptop name
- 22:11 – Login time
- 5.00s – Idle time
- 0.04s – JCPU (it the time used by all processes attached to the tty. It does not include past background jobs, but does include currently running background jobs.)
- 0.02s – PCPU (it is the time used by the current process, named in the “what” field.)
- vim replicant.py – The command line of their current process