CLI command "w" on Linux/Unix
w is a very helpful command-line tool for a quick overview of which users are currently logged in and what they are doing.

Even with years of experience in IT you keep running into something new. Recently I came across the CLI command w.
w gives a quick overview of which users are currently logged in to the system and what they are doing. On systems administered by multiple people, this is a fast way to find out who has an open SSH session and what they are currently up to. Useful during day-to-day work, and especially helpful when troubleshooting: it quickly tells you whether someone has already picked up the issue, or whether there were active SSH sessions at the time the problem occurred.
On a system with only one active SSH session the output looks like this:
20:58:35 up 49 days, 3:55, 1 user, load average: 0.01, 0.04, 0.00
USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT
tobi pts/0 90.186.XXX.XXX 20:58 1.00s 0.04s 0.00s w
Besides some general information (time of day, uptime, number of users and load average — averaged over the last 1, 5 and 15 minutes), an 8-column table is printed:
- the user in question
- the environment / terminal ID (TTY = "text input/output environment")
- the remote IP address of the user
- the time of the login
- how long the user has been idle
- cumulative CPU time of the user
- current CPU usage of the user in percent
- the process the user is currently running
This already gives a first impression of which users are logged in and what they are doing. Combined with other CLI tools such as htop, nload or iotop you get a quick picture of the current system state.