linux systemctl 常用命令整理

147 阅读1分钟
  • 列出所有已经加载的 systemd units

    systemctl systemctl | grep docker.service

  • 列出所有的 service

    systemctl list-units --type=service systemctl --type=service

  • 列出所有active状态(运行或退出)的服务

    systemctl list-units --type=service --state=active

  • 列出所有正在运行的服务

    systemctl list-units --type=service --state=running

  • 列出所有正在运行或failed状态的服务

    systemctl list-units --type service --state running,failed

  • 列出所有enabled状态的服务

    systemctl list-unit-files --state=enabled