83

Is there any command that would show all the available services in my wheezy Debian based OS?

I know that in order to see all the running services you can use service --status-all.

51

Wheezy uses SysV init, and all the services are controlled with special shell scripts in /etc/init.d, so ls /etc/init.d will list them. These files also contain a description of the service at the top, and the directory contains a README.

Some but not all of them have a .sh suffix, you should leave that off when using, eg., update-rc.d.

  • 1
    After reading your answer, I realized how stupid my question was. It was obvious. Anyway, at least I've learned something. Nevertheless thanks for answering my question. – Dragos Rizescu Jan 9 '14 at 17:54
  • 7
    @DragosRizescu there isn't stupid questions. – Braiam Jan 9 '14 at 18:00
  • 2
    @DragosRizescu - valid question, there has been a lot of activity in changing around how services work on the various distros so it can get confusing. – slm Jan 9 '14 at 18:02
  • I am running systemd on my wheezy system. – jordanm Jan 9 '14 at 20:21
67

On Debian jessie try: service --status-all.

It is in the sysvinit-utils package.

13
service --status-all

Will list all services with a status code, being stopped or off (-), started or on (+), or unknown (?), which means no status code section in their init.d script. Not just running services.

3

As said with systemd would be

systemctl --full --type service --all

From man page:

-l, --full Do not ellipsize unit names, process tree entries, journal output, or truncate unit descriptions in the output of status, list-units, list-jobs, and list-timers.

-a, --all When listing units with list-units, also show inactive units and units which are following other units. When showing unit/job/manager properties, show all properties regardless whether they are set or not.

Also useful, from ArchWiki:

systemctl             # List running units
systemctl list-units  # Idem
systemctl --failed    # List failed units
0

/etc/init.d contains scripts used by the System V init tools (SysVinit).

List executable:

ls -F /etc/init.d/ | grep '*$'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.