There are two methods of starting and managing services in Ubuntu: System-V style init and upstart. Keep reading if you want to know how to view the status of both.
The init daemon control tool, initctl, will show you the upstart controlled services:
sudo initctl list
To list all System-V services, the following runs all init scripts with the status commnd. This option only calls status on sysvinit jobs
service --status-all
This will output a list to stdout with a status flag in brackets at the beginning of each line. The following key explains:
[?]
means the service status isn’t known (the init file does not output a status)[+]
means the service is running[-]
means the service is not running
To re-redirect to a file instead of stdout:
service --status-all > services.txt
The problem with this is all undetermined services (the ones shown with [ ? ] alongside), still go to stdout. If you want all in a text file:
service --status-all &> services.txt
If you only want to print to the screen but don’t want to see the undetermined:
service --status-all 2> /dev/null