【问题标题】:systemctl short status output format for specific servicesystemctl 特定服务的短状态输出格式
【发布时间】:2020-06-03 12:37:50
【问题描述】:

是否可以获取特定 systemd 服务的状态

$ systemctl -a | grep sshd.service
  sshd.service              loaded    active   running   OpenSSH server daemon
$

但没有 grep,只有 systemctl ?类似systemctl SHOW_STATUS_LIKE_A_OPTION sshd.service

systemctl status - 太长且多行...

【问题讨论】:

    标签: systemctl


    【解决方案1】:

    你可以试试systemctl is-active sshd.servicesystemctl is-enabled sshd.servicesystemctl is-failed sshd.service

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-06-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多