博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ubuntu 查看进程,查看服务
阅读量:7188 次
发布时间:2019-06-29

本文共 8088 字,大约阅读时间需要 26 分钟。

jiqing@Ubuntu:~$ sudo netstat -anpl | grep :3306tcp6       0      0 :::3306                 :::*                    LISTEN      1532/mysqld     jiqing@Ubuntu:~$ sudo netstat -anpl | grep :80tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      2994/nginx: master jiqing@Ubuntu:~$ ps -ef | grep nginxroot      2994  1833  0 11:28 ?        00:00:00 nginx: master process nginxwww       2995  2994  0 11:28 ?        00:00:00 nginx: worker processwww       2996  2994  0 11:28 ?        00:00:00 nginx: worker processwww       2997  2994  0 11:28 ?        00:00:00 nginx: worker processwww       2998  2994  0 11:28 ?        00:00:00 nginx: worker processjiqing    3049  2515  0 11:31 pts/11   00:00:00 grep --color=auto nginxjiqing@Ubuntu:~$ ps -ef | grep mysqlroot      1016     1  0 11:25 ?        00:00:00 /bin/sh /usr/local/mysql/bin/mysqld_safe --datadir=/usr/local/mysql/var --pid-file=/usr/local/mysql/var/Ubuntu.pidmysql     1532  1016  0 11:25 ?        00:00:00 /usr/local/mysql/bin/mysqld --basedir=/usr/local/mysql --datadir=/usr/local/mysql/var --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --log-error=/usr/local/mysql/var/Ubuntu.err --open-files-limit=65535 --pid-file=/usr/local/mysql/var/Ubuntu.pid --socket=/tmp/mysql.sock --port=3306jiqing    3051  2515  0 11:31 pts/11   00:00:00 grep --color=auto mysql

列出所有的tcp端口

# netstat -ntlpActive Internet connections (only servers)Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      22473/redis-server  tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      4293/nginx: master  tcp        0      0 0.0.0.0:8211            0.0.0.0:*               LISTEN      4293/nginx: master  tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      1164/sshd           tcp        0      0 127.0.0.1:8383          0.0.0.0:*               LISTEN      23301/xs-indexd: se tcp        0      0 127.0.0.1:8384          0.0.0.0:*               LISTEN      23305/xs-searchd: m tcp        0      0 0.0.0.0:3306            0.0.0.0:*               LISTEN      8064/mysqld

列出所有的udp端口

# netstat -nulp激活Internet连接 (仅服务器)Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program nameudp    52224      0 0.0.0.0:68              0.0.0.0:*                           2563/dhclient   udp        0      0 0.0.0.0:631             0.0.0.0:*                           1238/cups-browsedudp        0      0 0.0.0.0:58025           0.0.0.0:*                           1064/avahi-daemon: udp        0      0 127.0.0.1:1080          0.0.0.0:*                           1739/python     udp    28736      0 0.0.0.0:5353            0.0.0.0:*                           6921/nw         udp     9280      0 0.0.0.0:5353            0.0.0.0:*                           4243/chrome     udp    31872      0 0.0.0.0:5353            0.0.0.0:*                           1064/avahi-daemon: udp6       0      0 :::35139                :::*                                1064/avahi-daemon: udp6   14656      0 :::5353                 :::*                                6921/nw         udp6   20672      0 :::5353                 :::*                                4243/chrome     udp6   20672      0 :::5353                 :::*                                1064/avahi-daemon:

查看外部的tcp

# netstat -ntlpa激活Internet连接 (服务器和已建立连接的)Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program nametcp        0      0 127.0.0.1:22624         0.0.0.0:*               LISTEN      7042/exe        tcp        0      0 127.0.0.1:36395         0.0.0.0:*               LISTEN      7042/exe        tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      1183/redis-server 1tcp        0      0 127.0.0.1:25613         0.0.0.0:*               LISTEN      6999/exe        tcp        0      0 127.0.0.1:63342         0.0.0.0:*               LISTEN      26309/java      tcp        0      0 127.0.0.1:19471         0.0.0.0:*               LISTEN      6999/exe        tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      1519/nginx.conf tcp        0      0 0.0.0.0:8211            0.0.0.0:*               LISTEN      1519/nginx.conf tcp        0      0 0.0.0.0:8212            0.0.0.0:*               LISTEN      1519/nginx.conf tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      11230/cupsd     tcp        0      0 127.0.0.1:1080          0.0.0.0:*               LISTEN      1739/python     tcp        0      0 0.0.0.0:8888            0.0.0.0:*               LISTEN      1519/nginx.conf tcp        0      0 127.0.0.1:6942          0.0.0.0:*               LISTEN      26309/java      tcp        0      0 127.0.0.1:40104         127.0.0.1:6379          TIME_WAIT   -               tcp        0      0 192.168.1.128:42862     101.132.169.194:22      ESTABLISHED 15204/ssh       tcp        0      0 192.168.1.128:53712     47.75.180.205:2000      ESTABLISHED 4243/chrome     tcp        0      0 127.0.0.1:34122         127.0.0.1:26483         ESTABLISHED 6921/nw         tcp        0      0 127.0.0.1:47234         127.0.0.1:3306          TIME_WAIT   -               tcp        0      0 127.0.0.1:40106         127.0.0.1:6379          TIME_WAIT   -               tcp        0      0 192.168.1.128:46428     101.226.76.164:443      ESTABLISHED 4243/chrome     tcp        0      0 192.168.1.128:44532     59.111.160.197:80       ESTABLISHED 1317/netease-cloud-tcp        0      0 127.0.0.1:47238         127.0.0.1:3306          TIME_WAIT   -               tcp        0      0 127.0.0.1:36214         127.0.0.1:80            ESTABLISHED 4243/chrome     tcp        0      0 192.168.1.128:60894     223.252.199.69:6003     ESTABLISHED 1317/netease-cloud-tcp        0      0 127.0.0.1:47144         127.0.0.1:3306          TIME_WAIT   -               tcp        0      0 127.0.0.1:55902         127.0.0.1:6379          ESTABLISHED 24062/rdm       tcp        0      0 127.0.0.1:47230         127.0.0.1:3306          TIME_WAIT   -               tcp        0      0 192.168.1.128:47122     101.132.169.194:22      ESTABLISHED 16503/ssh       tcp        0      0 192.168.1.128:58480     54.86.169.116:443       ESTABLISHED 27254/Postman   tcp        0      0 127.0.0.1:6379          127.0.0.1:55902         ESTABLISHED 1183/redis-server 1tcp        0      0 127.0.0.1:40122         127.0.0.1:6379          TIME_WAIT   -               tcp        0      0 192.168.1.128:52482     38.143.1.170:2020       ESTABLISHED 4243/chrome     tcp        0      0 127.0.0.1:47232         127.0.0.1:3306          TIME_WAIT   -               tcp        0      0 127.0.0.1:80            127.0.0.1:36214         ESTABLISHED 29553/nginx: workertcp        0      0 127.0.0.1:47222         127.0.0.1:3306          TIME_WAIT   -               tcp        0      0 127.0.0.1:35508         127.0.0.1:26483         ESTABLISHED 6921/nw         tcp        1      0 192.168.1.128:35168     106.15.95.197:80        CLOSE_WAIT  4243/chrome     tcp6       0      0 :::3306                 :::*                    LISTEN      2353/mysqld     tcp6       0      0 :::26483                :::*                    LISTEN      7042/exe        tcp6       0      0 :::54484                :::*                    LISTEN      6999/exe        tcp6       0      0 :::21                   :::*                    LISTEN      1560/vsftpd     tcp6       0      0 ::1:631                 :::*                    LISTEN      11230/cupsd     tcp6       0      0 127.0.0.1:26483         127.0.0.1:34122         ESTABLISHED 7042/exe        tcp6       0      0 127.0.0.1:3306          127.0.0.1:47228         TIME_WAIT   -               tcp6       0      0 127.0.0.1:3306          127.0.0.1:47224         TIME_WAIT   -               tcp6       0      0 127.0.0.1:3306          127.0.0.1:47226         TIME_WAIT   -               tcp6       0      0 127.0.0.1:26483         127.0.0.1:35508         ESTABLISHED 7042/exe

转载地址:http://iqukm.baihongyu.com/

你可能感兴趣的文章
MVC开发人员必须拥有的五大工具
查看>>
[New Portal]Windows Azure Virtual Machine (10) 自定义Windows Azure Virtual Machine模板
查看>>
在Web应用程序中执行计划任务(多线程)
查看>>
HDU 3999 The order of a Tree (先序遍历)
查看>>
一个对Entity Framework数据层的封装
查看>>
华为机试题——整数减法
查看>>
面试经典-分金条
查看>>
session的失效时间
查看>>
WCF 4.0 进阶系列 – 第十五章 构建REST服务(第二部分)
查看>>
MySQL5.7: datetime
查看>>
Virtualenv教程
查看>>
2011年8月11日星期四
查看>>
艾伟也谈项目管理,项目管理实战之团队管理
查看>>
IE9是最佳浏览器?
查看>>
快速把web项目部署到weblogic上
查看>>
objcopy
查看>>
RGB_YUV_YCbCr
查看>>
虚拟内存机制
查看>>
一个CSV文件解析类
查看>>
javascript调用C#后台程序执行查询
查看>>