I do not know the service\'s name, but would like to stop the service by checking its status.
For example, if I want to check if the PostgreSQL service is running or no
You can use the below command to check the list of all services.
ps aux
To check your own service:
ps aux | grep postgres