Service & System

loginctl

Control the systemd login manager — manage user sessions and seats.

Synopsis

syntax
loginctl [OPTION]... COMMAND [ARG]...

Examples

Show active login sessions
loginctl list-sessions
List logged-in users
loginctl list-users
Kill session 42
loginctl terminate-session 42
Show details of session 1
loginctl show-session 1

Common options

FlagDescription
list-sessionsList current sessions
list-usersList logged-in users
show-sessionShow session properties
terminate-sessionKill a session
terminate-userKill all sessions for user

About loginctl

The `loginctl` command control the systemd login manager — manage user sessions and seats. Service and system commands manage daemons, scheduled tasks, system boot, and shutdown operations.

Modern Linux distributions use systemd for service management, though some still support SysVinit scripts. Understanding these commands is essential for deploying and maintaining production services.

The command accepts 5 commonly used flags shown above, though the full set of options is available in the man page (`man loginctl`). The 4 examples on this page cover typical real-world usage patterns that you can copy and adapt for your own workflows.

Related commands

More Service & System Commands

Other commands in the Service & System category

Related tools