centos7查看/列出所有服务状态

时间:2021-06-18 15:45 作者:IIS7 admin

    centos7 列出所有系统服务
    sudo systemctl list-unit-files
 
    centos 查看所有运行中的服务ip和端口信息
    netstat -tunpl
    #运行结果:
    [root@iZ940 ~]# netstat -tunpl
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address        Foreign Address  State    PID/Program name
    tcp        0      0 0.0.0.0:8033     0.0.0.0:*   LISTEN     14162/nginx
    tcp        0      0 127.0.0.1:9000    0.0.0.0:*    LISTEN     1418/php-fpm
    tcp        0      0 0.0.0.0:3306      0.0.0.0:*    LISTEN     2020/mysqld
    tcp        0      0 127.0.0.1:6379       0.0.0.0:*    LISTEN     8987/redis-server
    tcp        0      0 0.0.0.0:80         0.0.0.0:*    LISTEN     14162/nginx
    tcp        0      0 0.0.0.0:5555        0.0.0.0:*    LISTEN     2129/./yunsuo_agent
    tcp        0      0 0.0.0.0:22          0.0.0.0:*    LISTEN     1640/sshd