Linux command to view user login information
On Linux, To display the currently logged-in user session, you can use the command:
w
20:22:13 up 1:29, 1 user, load average: 0.00, 0.01, 0.00: the current system time and system running time, the current number of logged-in users, and the system’s average load information.
- USER: username
- TTY: Login terminal type
- FROM: Remote terminal address
- LOGIN@: Login time
- IDLE: Idle time; this is a timer that will be reset as soon as the user performs any action
- JCPU: The time is taken by all processes connected to the terminal, including the currently running background job
- PCPU: Time is taken by the current process
- WHAT: Tasks currently being performed
Show currently logged in a user session with who command
Show all login names and number of logged-in users
Show the currently logged in user with whoami command