Wednesday 7 March 2018

Find and kill a process which is listening on port 8080 | Windows


netstat –aon | find "<port number>"
Example:
netstat -ano -t  | findstr LISTENING | findstr :8080


now kill using taskkill command

taskkill /F /pid xxx

or kill by name for example.
taskkill /im notepad.exe

Tip: to find a string in a file using findstr:
findstr /i "helloworld" abc.txt
or
findstr /i "^hell*rld" abc.txt


------------------------------

Linux:
my best command:
netstat -tulpen

example:
netstat -tulpn | grep LISTEN | grep '(8080 |8081 |8082 | xxx)'

or

$ lsof -i tcp:1555

No comments:

Post a Comment