0

I want to get a list of active and not-found systemd (user) units.

$ systemctl --user list-units --state=not-found
  UNIT                              LOAD      ACTIVE   SUB     DESCRIPTION
● server.service                    not-found active   running server.service
● pipewire-media-session.service    not-found inactive dead    pipewire-media-session.service
...

This lists both active and inactive units. As systemctl's manual, you can combine them as --state=not-found,active, but acts like an OR filter, not AND.

I guess I can just grep the previous output, but I want to ask if I can do this with just systemctl.

New contributor
viperML is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
1
  • Maybe systemctl is-enabled UNIT is something you might want to use, check man systemctl for its return values. Otherwise you need to use grep.
    – paladin
    12 hours ago

0

You must log in to answer this question.

Browse other questions tagged .