Linux查看占用端口程序
1、查看占用8080端口的进程 [root@localhost apps]# netstat -apn | grep '8080' tcp 0 0 :::8080 :::* LISTEN 3394/java 如上面的3394位进程编号 2、查看该进程编号对应的程序 [root@localhost apps]# ps -aux | grep 3394 Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ root 3394 2.0 20.7 226388 51608 pts/1 Sl 06:38 1:02 java -jar springboot-integration.jar root 3748 0.0 0.2 4356 720 pts/1 S+ 07:30 0:00 grep 3394 3、杀死进程 kill -9 3394 4、根据进程号查看所属程序的位置 ls -al /proc/[进程号] [root@localhost bin]# ls -al /proc/2260 lrwxrwxrwx. 1 root root 0 Jul 4 06:48 cwd -> /opt/zookeeper-3.4.6/bin
----------------------------------------------------------------------------------------------------------------------
附加上windows的
C:\>netstat -aon | findstr "8081"
TCP 0.0.0.0:8081 0.0.0.0:0 LISTENING 6920
TCP [::]:8081 [::]:0 LISTENING 6920
tskill 6920
相关推荐
playlinuxxx 2020-07-18
LinuxWorking 2013-07-26
tchonggang 2015-08-12
yimu 2015-07-16
阳光之吻 2016-12-18
pwl 2017-07-10
test0 2016-12-18
jmdvirus 2015-08-12
xiaxiaoyule 2015-06-01
Linux学习笔记 2014-08-29
学峰的学习笔记 2012-08-30
小波波 2012-08-02
gdb 2012-02-22
昭君出塞 2012-01-06
yuhuqiao 2011-04-20
Kshine0 2010-06-17