
可以在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
SysV服务管理系统 例如 RedHat6等发行版service --status-all 查看所有服务
service servicename status 查看指定服务状态
service servicename start|stop|restart 启动|停止|重启 指定服务
systemd服务管理系统 如CentOS 7等
systemctl is-enabled servicename.service #查询服务是否开机启动
systemctl enable *.service #开机运行服务
systemctl disable *.service #取消开机运行
systemctl start *.service #启动服务
systemctl stop *.service #停止服务
systemctl restart *.service #重启服务
systemctl reload *.service #重新加载服务配置文件
systemctl status *.service #查询服务运行状态
systemctl --failed #显示启动失败的服务
linux怎么查看开机启动项?我们一起来了解一下吧。1、打开linux系统,在linux的桌面的空白处右击。
2、在d出的下拉选项里,点击打开终端即可进入命令行。
3、输入chkconfig命令,回车运行即可查看开机启动项。
本文章基于ThinkpadE15品牌、centos7系统撰写的。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)