zoukankan      html  css  js  c++  java
  • 如何查看进程/服务是否启动

    在linux下我们一般是需要了解我们的进程的状态的.
    我们以mysql为例

    service mysqld status

    [root@VM_57_70_centos ~]# service mysqld status;
    mysqld (pid  17239) is running...
    [root@VM_57_70_centos ~]# 
    
    

    我这里是启动状态,可以看见pid

    chkconfig --list +你的服务

    [root@VM_57_70_centos ~]# chkconfig --list mysqld;
    mysqld         	0:off	1:off	2:on	3:on	4:on	5:on	6:off
    [root@VM_57_70_centos ~]# 
    

    可以看见是启动的,有on状态

    pidof +你的服务

    [root@VM_57_70_centos ~]# pidof mysqld
    17239
    [root@VM_57_70_centos ~]# 
    
    

    可以看见pid,说明,此时,mysql服务正在运行,如果没有运行的话,是没有输出的

    ps -ef | grep +你的服务

    这里写图片描述

    可以通过netstat -tanp查看

    这里写图片描述

    如果有的话,上面也是会有mysql这一条的

    好了,上面简单介绍了几种常用的方式来查看进程,选择一种你喜欢的就好

    2019-07-01号新增Mac查看方式

    某个端口:

    netstat -tan | grep 2181
    
  • 相关阅读:
    FFT入门
    FJOI省队集训 chessboard
    FJOI省队集训 florida
    树上莫队
    NOIP2015 Revenge
    APIO2013 tasksauthor
    油漆门
    一些字符串有关的题目
    字符串题模板集合
    sg函数与博弈论2
  • 原文地址:https://www.cnblogs.com/liuge36/p/12614831.html
Copyright © 2011-2022 走看看