How can I list all enabled
services from systemctl
?
I know running systemctl
command by itself lists all services, but I would like to only get the enabled
ones.
servicessystemd
How can I list all enabled
services from systemctl
?
I know running systemctl
command by itself lists all services, but I would like to only get the enabled
ones.
Best Answer
systemctl list-unit-files | grep enabled
will list all enabled ones.If you want which ones are currently running, you need
systemctl | grep running
.Use the one you're looking for. Enabled, doesn't mean it's running. And running doesn't mean it's enabled. They are two different things.
Enabled means the system will run the service on the next boot. So if you enable a service, you still need to manually start it, or reboot and it will start.
Running means it's actually running right now, but if it's not enabled, it won't restart when you reboot.