How to check if a particular service is running on Ubuntu
I don't have an Ubuntu box, but on Red Hat Linux you can see all running services by running the following command:
service --status-all
On the list the +
indicates the service is running, -
indicates service is not running, ?
indicates the service state cannot be determined.
For Ubuntu (checked with 12.04)
You can get list of all services and select by color one of them with 'grep':
sudo service --status-all | grep postgres
Or you may use another way if you know correct name of service:
sudo service postgresql status
Maybe what you want is the ps command;
ps -ef
will show you all processes running. Then if you have an idea of what you're looking for use grep to filter;
ps -ef | grep postgres