linux中根据端口号开查找PID
2013-02-19 16:36
295 查看
[root@localhost huage]# netstat -anp |grep 111tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1415/rpcbind tcp 0 0 :::111 :::* LISTEN 1415/rpcbind udp 0 0 0.0.0.0:111 0.0.0.0:* 1415/rpcbind udp 0 0 :::111 :::* 1415/rpcbind
netstat:-a 显示全部-a, --all Show both listening and non-listening sockets. With the --interfaces option, show interfaces that are not marked
-n 显示端口号而不是名称 --numeric , -n Show numerical addresses instead of trying to determine symbolic host, port or user names.
-p 显示相关进程的PID及程序-p, --program Show the PID and name of the program to which each socket belongs.
-t 显示已经建立的连接
[root@1-min test]# netstat -nptActive Internet connections (w/o servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 52 192.168.18.129:22 192.168.18.1:52826 ESTABLISHED 1628/sshd: huage [p tcp 0 0 192.168.18.129:22 192.168.18.1:52422 ESTABLISHED 1575/sshd: huage [p tcp 0 0 192.168.18.129:2049 192.168.18.136:697 ESTABLISHED - tcp 0 0 192.168.18.129:22 192.168.18.1:51551 ESTABLISHED 1532/sshd: huage [p
根据端口号来查询PID之二:[root@localhost huage]# lsof -i:111 //冒号后接的是端口号COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMErpcbind 1415 rpc 6u IPv4 11465 0t0 UDP *:sunrpc rpcbind 1415 rpc 8u IPv4 11470 0t0 TCP *:sunrpc (LISTEN)rpcbind 1415 rpc 9u IPv6 11472 0t0 UDP *:sunrpc rpcbind 1415 rpc 11u IPv6 11475 0t0 TCP *:sunrpc (LISTEN)
转载自:http://blog.sina.com.cn/s/blog_716844910100te6z.html
netstat:-a 显示全部-a, --all Show both listening and non-listening sockets. With the --interfaces option, show interfaces that are not marked
-n 显示端口号而不是名称 --numeric , -n Show numerical addresses instead of trying to determine symbolic host, port or user names.
-p 显示相关进程的PID及程序-p, --program Show the PID and name of the program to which each socket belongs.
-t 显示已经建立的连接
[root@1-min test]# netstat -nptActive Internet connections (w/o servers)Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 52 192.168.18.129:22 192.168.18.1:52826 ESTABLISHED 1628/sshd: huage [p tcp 0 0 192.168.18.129:22 192.168.18.1:52422 ESTABLISHED 1575/sshd: huage [p tcp 0 0 192.168.18.129:2049 192.168.18.136:697 ESTABLISHED - tcp 0 0 192.168.18.129:22 192.168.18.1:51551 ESTABLISHED 1532/sshd: huage [p
根据端口号来查询PID之二:[root@localhost huage]# lsof -i:111 //冒号后接的是端口号COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMErpcbind 1415 rpc 6u IPv4 11465 0t0 UDP *:sunrpc rpcbind 1415 rpc 8u IPv4 11470 0t0 TCP *:sunrpc (LISTEN)rpcbind 1415 rpc 9u IPv6 11472 0t0 UDP *:sunrpc rpcbind 1415 rpc 11u IPv6 11475 0t0 TCP *:sunrpc (LISTEN)
转载自:http://blog.sina.com.cn/s/blog_716844910100te6z.html
相关文章推荐
- linux根据进程号PID查找启动程序的全路径
- linux 根据端口号查找对应进程的ID,操作进程
- linux中根据进程的PID值来查找执行文件的及其路径
- linux通过端口号(进程号pid)查找程序执行路径
- linux根据进程号PID查找启动程序的全路径
- linux根据进程号PID查找启动程序的全路径
- 根据端口号查找相应PID,从而在任务管理器中结束或查看相应进程
- Linux根据端口号查看进程PID
- linux中根据进程的PID值来查找执行文件的及其路径
- linux下根据进程号PID查找程序路径
- Linux基础教程 linux下使用find命令根据系统时间查找文件用法
- Linux 根据时间来查找
- linux根据pid获取进程名和获取进程pid(c语言获取pid)
- Linux下find命令——根据文件的大小查找(带截图)
- linux根据端口号查询来源程序
- linux下查看端口号的占用,根据端口号查看执行文件
- Linux用ps命令查找进程PID再用kill命令终止进程的方法
- linux下根据端口号查询对应进程
- IIS7根据PID查找对应的站点