- Linux Administration Cookbook
- Adam K. Dean
- 87字
- 2021-07-02 14:24:40
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.