linux怎样查看 某项服务 当前启动状态

2025-04-06 15:10:01
推荐回答(4个)
回答1:

可以在Linux下输入命令:

1、$service sshd status

2、#service servicename status是当前状态

3、#chkconfig --list servicename是查看启动状态,也就是是否开机自动启动

注:

1、如果service和chkconfig 找不到,可以试试/sbin/service和/sbin/chkconfig

2、如果用ubuntu好像是要用/etc/init.d/servicename status查看当前状态

(servicename就是你要查的服务名)

扩展资料:

查看某项服务当前启动状态的其他方式

一、利用进程来查看 

命令里 ps -aux | grep xxx 是查看某个进程或者服务是否存在。 

二、利用services命令 

1、查看单个服务的运行状态: service 服务名 status 

如:[root@localhost ~]# service sshd status 

openssh-daemon (pid 3701) 正在运行… 

2、查看所有服务的运行状态: service –status -all 

回答2:

#service servicename status是当前状态
#chkconfig --list servicename是查看启动状态,也就是是否开机自动启动
如果service和chkconfig 找不到,可以试试/sbin/service和/sbin/chkconfig
如果用ubuntu好像是要用/etc/init.d/servicename status查看当前状态
(servicename就是你要查的服务名)

回答3:

#service servicename status
比如查看防火墙:#service iptables status

#chkconfig --list |grep 服务名
比如查看telnet:#chkconfig --list |grep telnet

不知你想知道哪种 就都写下来了

回答4:

--查看当前服务器所有服务

service --status-all 

-- 查看当前所有正在运行的服务

service --status-all | grep running 

--查看指定服务运行状态如 httpd

service --status-all | grep httpd

或 service httpd status

--查看系统启动自启动的服务列表

chkconfig --list

--centos7版本

--查看正在运行的服务

systemctl | grep running

--列出运行的服务

initctl list

--查看指定服务运行状态

systemctl | grep apache2

--查看正在运行的服务

pstree

--查看正在运行的状态

chkservice --是一个管理系统单元的终端工具   

查看 某项服务 当前启动状态 主要是一些Linux命令操作,了解了Linux的命令操作起来其实很简单,推荐下方搜索方式进行Linux命令查询。