systemctl

systemctl short status output format for specific service


is it possible to get status for specific systemd service

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

but without grep, only with systemctl ? Something like systemctl SHOW_STATUS_LIKE_A_OPTION sshd.service

systemctl status - too long and multiline...


Solution

  • You can try systemctl is-active sshd.service, systemctl is-enabled sshd.service and systemctl is-failed sshd.service.