systemctlサービスのアクティブステータスシートのみを印刷するには?

systemctlサービスのアクティブステータスシートのみを印刷するには?
systemctl status httpd

● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Fri 2019-10-11 00:35:58 EEST; 1 weeks 3 days ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 29728 ExecReload=/usr/sbin/httpd $OPTIONS -k graceful (code=exited, status=0/SUCCESS)
 Main PID: 10722 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   Memory: 8.7M

行の下にホスト名を印刷したい。

Active: active (running) since Fri 2019-10-11 00:35:58 EEST; 1 weeks 3 days ago

ベストアンサー1

systemctl --no-pager status httpd | grep Active必要な出力を返す必要があります。

おすすめ記事