Search

Total Pageviews

Categories

Linux (8) Windows (5) Container (4) Development (4) Database (3) Docker (3) Mac OS (3) QuickStart (3) Ubuntu (3) AWS (1) Fedora (1) FreeBSD (1) Git (1) Java (1) MyBatis (1) Oracle Linux (1) Spring Boot (1) Unix (1) VMware (1) Virtualization (1) kdevtmpfsi (1) kinsing (1)

Featured Post

Your container's CPU usage is more than 100%, "kdevtmpfsi" the cryptomining malware is running | So how to resolve

How to resolve when "kdevtmpfsi" the crypto-mining malware is running and taking all CPU load of your server (container). One d...

Wednesday, July 3, 2019

How to find and kill the program that's using a specific port number Windows and Linux

Windows:

1. Find the program that is using a port number:

D:\>netstat -ano | findstr 8090
  TCP    0.0.0.0:8090           0.0.0.0:0              LISTENING       10716
  TCP    [::]:8090              [::]:0                 LISTENING       10716

2. Kill the program:

D:\>taskkill /F /pid 10716
SUCCESS: The process with PID 10716 has been terminated.

Linux:

1. Find the program that is using a port number:

[koacervate@SVT00005523 ~]$ sudo netstat -lnp | grep 6379
tcp        0      0 10.16.30.76:6379        0.0.0.0:*               LISTEN      24982/redis-server
tcp        0      0 127.0.0.1:6379          0.0.0.0:*               LISTEN      24982/redis-server

2. Kill the program:

[koacervate@SVT00005523 ~]$ ps -aef | grep redis
root     24982     1  0 13:31 ?        00:00:00 /usr/local/bin/redis-server 127.0.0.1:6379
htct     25086 24560  0 13:31 pts/0    00:00:00 grep --color=auto redis
[koacervate@SVT00005523 ~]$ sudo kill -9 24982

:))

No comments:

Post a Comment