Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command to get the service status of mac os

Here is the command to get the service status of linux : service ${services} status. I want the code to get the service status of the mac os. Any help would be appreciable.

like image 575
Melvin Moses Avatar asked Apr 13 '16 09:04

Melvin Moses


People also ask

How do I check services on my Mac?

Open the app menu (to the right of the Apple menu ), choose Services, then choose a service.

How do I see what services are running on Mac terminal?

Launch Terminal (Finder > Applications > Utilities). When Terminal is running, type top and hit Return. This will pull up a list of all your currently running processes. As in the Activity Monitor, this list shows your processes in decreasing order of how much of your resources they're consuming.


1 Answers

You only are able to list the services:

sudo launchctl list

Mix it with some grep and you have it.

sudo launchctl list | grep service <-- Here you put the service you're looking for

The output has the following meaning:

  • First number is the PID of the process, if it's running, if it isn't running, it shows a '-'.
  • Second number is the exit code of the process, if it has finished. If it's negative, it's the number of the kill signal.
  • The third column ios the process name.
like image 100
Eduardo Yáñez Parareda Avatar answered Oct 11 '22 19:10

Eduardo Yáñez Parareda