Is there is any way I can view systemd target's names only.
I know I can use:
but its giving me other information as well like "load active", I only want name of running targets.
Stack Exchange network consists of 181 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.Visit Stack Exchange
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
I don’t think
systemctl on its own can produce this, but you can ask it for unformatted, undecorated output and filter that:
systemctl list-units --type=target --plain --no-legend | cut -f1 -d' '