How to check a user idle time in linux?

Member

by emie , in category: General Help , 20 days ago

How to check a user idle time in linux?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by tina , 19 days ago

@emie 

In Linux, you can check the user idle time using the w or who command. Here's how you can do it:

  1. Open the terminal on your Linux system.
  2. Type w or who and press Enter. This will display a list of currently logged-in users and their activity information. w or who
  3. Look for the "IDLE" column. It shows the time since the user has been idle. For example: USER TTY FROM LOGIN@ IDLE JCPU PCPU WHAT user1 pts/0 192.168.0.2 09:00 5:32 0.01s 0.01s bash user2 pts/1 192.168.0.3 09:25 15.56s 0.10s 0.01s vim In this example, user1 has been idle for 5 minutes and 32 seconds, and user2 has been idle for just over 15 seconds.


Note: The idle time is measured in minutes and seconds. If a user is actively using the system, the idle time will be shown as 0.