Forrest logo
back to the loginctl tool

loginctl:tldr:950d6

loginctl: Execute a `loginctl` operation on a remote host.
$ loginctl list-users -H ${hostname}
try on your machine

This command is used to list all the users currently logged in on a specific host (denoted by ${hostname}). Here's a breakdown of the command: - loginctl: It is a command-line utility used to control the systemd-login manager, which manages user logins and seats on a Linux system. - list-users: This is a subcommand of loginctl used to display a list of currently logged-in users. - -H ${hostname}: This option allows you to specify the target host (hostname) on which you want to check the logged-in users. The ${hostname} placeholder should be replaced with the actual hostname or IP address of the target host. By executing this command with the appropriate hostname, you will get a list of all the users currently logged in on that specific host.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the loginctl tool