check service status in linux

C++
service --status-all
service --status-all | more
service --status-all | grep ntpd
service --status-all | less$ sudo service httpd status
httpd is stopped
$ sudo service httpd status
httpd is stopped
Source

Also in C++: