Menu

How to check if service is running with CRON job?

How to enable service to run on boot in Ubuntu 18.04?

How to list all services in Ubuntu 18.04?

18.04 ubuntu systemctl services bash

There are many ways to display all linux services. But to be honest, these methods fails to list all services usually. The proper one to use, utilizes systemctl command. Your system might use different service initialization commands, like popular service. However when command systemctl is available it should yield good results with list-units option. Some extra parameters are added, which are self explainable.

List all services

systemctl list-units --all --type=service --no-pager
The output of command lists table with service name, whether it is enabled and if it is running at the moment as well some description.

Example output of command

UNIT                             LOAD      ACTIVE   SUB     DESCRIPTION
  accounts-daemon.service          loaded    active   running Accounts Service
  acpid.service                    loaded    active   running ACPI event daemon
  alsa-restore.service             loaded    active   exited  Save/Restore Sound Card State
  alsa-state.service               loaded    inactive dead    Manage Sound Card State (restore and store)
  anacron.service                  loaded    inactive dead    Run anacron jobs
● apache2.service                  masked    inactive dead    apache2.service
  apparmor.service                 loaded    active   exited  AppArmor initialization
  apport.service                   loaded    active   exited  LSB: automatic crash report generation
  apt-daily-upgrade.service        loaded    inactive dead    Daily apt upgrade and clean activities
  apt-daily.service                loaded    inactive dead    Daily apt download activities
  atd.service                      loaded    active   running Deferred execution scheduler

services.png