ubantu查看端口,linux系统端口查看
查看端口所在线程lsof-I:8080 MAC-abeen:spider abeen $ lsof-I:8080命令PID用户软驱类型设备大小/关闭节点名称Python 5651 abeen 9u IP v40x B1 d 20 b 318d 3 e 65 ed 0t 0 TCP *:http-alt(LISTEN)Python 5651 abeen 10u IPv60x B1 d 20 b 3187 b 23 fed 0t 0 TCP *:http-alt(LISTEN)查看老兄终端端口命令netstat -AaLlnW(相当于Linux操作系统操作系统的MAC-abeen:spider abeen $ netstat-AaLlnWCurrent Listen队列大小(qlen/incqlen/maxqlen)套接字流哈希监听本地地址b1d 20 b 319398 e96d 0/0/1 127。0 .0 .1 .56987 b1d 20 b 3193 A0 ec6d 0 0/0/128 127。0 .0 .1 .56966 b1d 20 b 318 df 39馈0 0 0/0/0/1 127。0 .0 .0查看端口是否被占用mac-abeen:蜘蛛abeen $ sudo lsof-I:8080 password:COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE name Python 5651 abeen 9u IP v40x B1 d 20 b 318d 3 e 65 ed 0t 0 TCP *:http-alt(监听)Python 5651 abeen 10u IPv60x B1 d 20 b 3187 b 23 fed 0t 0 TCP *:http-alt(监听)MAC-abeen:spider abeen $ netstat-ANP TCP grep 80*监听tcp4 0 0 *.8080 * .*倾听结束占用端口的所有进程lsof-P grep :8080 awk { print $ 2 } xargs kill-9
转载于:https://www。cn博客。com/abeen/p/11072235。超文本标记语言