How do you check the status of a service with systemctl?
systemctl status <unit> gives the full picture — active state, main PID, and recent log lines; is-active/is-enabled/is-failed give scriptable one-word answers.
systemctl status sshd.service is usually the first command you run when "something's wrong with a service" — and crucially it ends with the last few journal lines for that unit, so you often see the error without even opening journalctl.
systemctl status sshd.service
What it shows:
- the unit's description and the path of its unit file
- whether it's loaded, and
active (running)/inactive (dead)/failed - the main PID and current memory/CPU usage
- the most recent log entries from the journal
For scripts and quick checks, the is-* subcommands return a single word and a useful exit code (so you can branch on them in a shell script):
| Command | Returns |
|---|---|
systemctl is-active sshd |
active / inactive |
systemctl is-enabled sshd |
enabled / disabled |
systemctl is-failed sshd |
active / failed |
See everything that's broken at once:
systemctl --failed --type=service
Tip: because status already embeds recent journal output, it's frequently all you need to diagnose a crash — only drop to journalctl -u sshd when you need more history than the last few lines.