1

I feel like this should be simple, i know the centos 7 command for it but cannot find the centos 6 command to list all enabled services.

Centos 7 command i have is

systemctl list-unit-files | grep enabled

I get a nice list off all the services that are enabled. I just need to get the same list from a centos 6 server?

1
  • This should also work: systemctl list-units - - state=enabled
    – aardbol
    Commented Jun 8, 2020 at 7:50

1 Answer 1

3

You could use like this :

service --status-all | grep -E 'running|enabled'

OR

You can also try this :

chkconfig --list | grep '3:on'
3
  • Thanks i think the second one was what i am after assuming 3:on is the same as enabled?
    – a.smith
    Commented Jun 8, 2020 at 8:11
  • Pleasure . Yes , if 3 is on , it is enabled for run level 3 ( which is basically CLI ). Commented Jun 8, 2020 at 8:13
  • 1
    3:on should work if your default runlevel is 3. I've never seen a service that is turned on for runlevel 5 (graphical login) but not 3 (console login) so it should work even if you're booting into runlevel 5 by default. For what its worth, in EL6, gdm is launched via Upstart so it doesn't have an init.d file. so don't look for it there. Its in /etc/init/prefdm.
    – jsbillings
    Commented Jun 8, 2020 at 15:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .