Linux Administration Cookbook
上QQ阅读APP看书,第一时间看更新

There's more...

As with services that're loaded and running, you may be interested in services that have loaded, done whatever job they were intended for, and then exited:

$ systemctl list-units --type service --state exited

Or perhaps you're interested in services that have failed? Try the following:

$ systemctl list-units --type service --state failed
Lastly, systemd will use a pager by default to display results, which while human-friendly, isn't great for scripts. To simply print the output of your command to stdout, add --no-pager to your command.