日期:2014-05-16  浏览次数:20729 次

Linux下查看某端口占用进程
文章分类:操作系统
在Linux操作系统中

查看占用某一端口的进程是什么:#lsof -i:端口号
或者
netstat -apn | grep redis

[root@192_168_56_28 ~]# lsof -i:80
COMMAND   PID  USER   FD   TYPE DEVICE SIZE NODE NAME
nginx   21916  root    6u  IPv4  43908       TCP *:http (LISTEN)
nginx   21917 nginx    6u  IPv4  43908       TCP *:http (LISTEN)
nginx   21918 nginx    6u  IPv4  43908       TCP *:http (LISTEN)
nginx   21919 nginx    6u  IPv4  43908       TCP *:http (LISTEN)
nginx   21921 nginx    6u  IPv4  43908       TCP *:http (LISTEN)
nginx   21922 nginx    6u  IPv4  43908       TCP *:http (LISTEN)
nginx   21923 nginx    6u  IPv4  43908       TCP *:http (LISTEN)
nginx   21924 nginx    6u  IPv4  43908       TCP *:http (LISTEN)
nginx   21925 nginx    6u  IPv4  43908       TCP *:http (LISTEN)
nginx   21926 nginx    6u  IPv4  43908       TCP *:http (LISTEN)
nginx   21927 nginx    6u  IPv4  43908       TCP *:http (LISTEN)


[root@192_168_56_28 ~]# netstat -apn | grep redis
tcp        0      0 0.0.0.0:6379                0.0.0.0:*                   LISTEN      21084/redis-server  


查看 所有

lsof