Is there is any way I can view systemd target's names only.
I know I can use:
systemctl --type=target
but its giving me other information as well like "load active", I only want name of running targets.
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 communityI 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' '