Linux command
loginctl 命令
文本
复制后可按需替换文件名、目录或参数。
常用示例
Example
loginctl
Example
loginctl show-session session_id -a
Example
loginctl show-user username
Example
loginctl show-user username -p Property
Example
loginctl list-users -H hostname
Log out
loginctl terminate-user username
Lock
loginctl lock-sessions
说明
loginctl controls the systemd login manager (systemd-logind). It can be used to introspect and control the state of user sessions, seats, and the login manager itself.
参数
- -a, --all
- Show all properties
- -p, --property
- Show specific property
- -H, --host
- Execute on remote host
- -M, --machine
- Execute in container
- --no-pager
- Do not pipe output to pager
- --no-legend
- Do not print header/footer
FAQ
What is the loginctl command used for?
loginctl controls the systemd login manager (systemd-logind). It can be used to introspect and control the state of user sessions, seats, and the login manager itself.
How do I run a basic loginctl example?
Run `loginctl` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -a, --all do in loginctl?
Show all properties