Home >Operation and Maintenance >Linux Operation and Maintenance >How to check service status information in Linux

How to check service status information in Linux

王林
王林Original
2019-12-17 11:39:466024browse

How to check service status information in Linux

How to check which services are running on our Linux system? First we enter the following command:

ps -ef

How to check service status information in Linux

Let’s first see if the system contains this service. For example, I want to see my nginx server (note the case):

ps -ef | grep nginx

How to check service status information in Linux

Related video tutorial sharing: linux video tutorial

If you want to kill this service, you can use the following command:

kill ID

How to check service status information in Linux

You can use the above two commands to obtain the ID. The second column is the ID, and the obtained ID is the same (the third line is the command you just entered to search ID).
To view the detailed status of this service, we can use the following command:

service nginx status

How to check service status information in Linux

Other commands are as follows (I use nginx as an example):

重启该服务:sudo service nginx restart
开启该服务:sudo service nginx start
停止该服务:sudo service nginx stop

Recommended related articles and tutorials: linux tutorial

The above is the detailed content of How to check service status information in Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn