systemctl 命令用于管理各种类型的systemd对象,成为单元。
systemctl -t help显示可用的单元类型的列表
systemctl status name.type查看服务的状态,如没有制定type值,将显示服务单位的状态。
systemctl is-enabled sshd查看是否开机启动
systemctl is-active 查看是否正常运行
systemctl --failed --type=service仅查看启动失败的服务
systemctl list-unit-files [--type=service]查看所有单元已启用也已禁用设置
systemctl list-units--type=service列出已经加载单元的活动状态
systemctl list-units--type=service--all 同时列出不活动的单元状态