From 56c8d51b3b00d8f8919f0b464d8c4c04e8197368 Mon Sep 17 00:00:00 2001 From: Johannes Stoelp Date: Mon, 7 Aug 2023 23:36:06 +0200 Subject: systemd: add state/type query examples --- src/linux/systemd.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/linux/systemd.md b/src/linux/systemd.md index 14ced0b..18f87e5 100644 --- a/src/linux/systemd.md +++ b/src/linux/systemd.md @@ -7,6 +7,9 @@ Inspect units: systemctl [opts] [cmd] [opts] --user + --type=TYPE List only given types eg, service, timer, socket (use --type=help for a list) + --state=STATE List only given states eg running, enabled (use --state=help for a list) + --failed List only failed services [cmd] list-units List units in memory @@ -25,6 +28,15 @@ systemctl [opts] [cmd] show Show properties of unit ``` +### Example: List failed units +```bash +# List all system failed units. +systemctl --failed + +# List all user failed units. +systemctl --user --failed +``` + ### Example: Trivial user unit ```bash -- cgit v1.2.3