• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

loginctl Command Examples in Linux

by Deepika

loginctl is a command line utility used to manage and control the systemd-logind login manager, which is used to manage user logins and sessions on Linux systems using systemd. It provides a variety of functions, including starting and stopping user sessions, listing active sessions and users, and managing the settings and properties of user sessions.

loginctl is an essential tool for system administrators and developers who need to manage and control the systemd-logind login manager. It provides a flexible and convenient interface for controlling user sessions and managing the settings and properties of the login manager, making it an important part of the systemd system management suite.

loginctl Command Examples

1. Print all current sessions:

# loginctl list-sessions

2. Print all properties of a specific session:

# loginctl show-session session_id --all

3. Print all properties of a specific user:

# loginctl show-user username

4. Print a specific property of a user:

# loginctl show-user username --property=property_name

5. Execute a `loginctl` operation on a remote host:

# loginctl list-users -H hostname

Filed Under: Linux

Some more articles you might also be interested in …

  1. CentOS / RHEL 6 : How to rebuild Initial Ramdisk Image
  2. cargo doc: Build and view Rust package documentation offline
  3. rig: command not found
  4. git cat-file: Provide content or type and size information for Git repository objects
  5. dvc diff: Show changes in DVC tracked file and directories
  6. du Command Examples in Linux
  7. gdal_contour: Create contour lines and polygons from a digital elevation model
  8. id Command Examples in Linux
  9. duc Command Examples in Linux
  10. httpie Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright