I want to kill process that runs at some port. In ubuntu I used fuser -k 8000/tcp. What is the Mac OS way?
I found out this way:
lsof -i tcp:8000
kill -9
But it's very long. I need one short command like fuser
Thanx
bashmacos
I want to kill process that runs at some port. In ubuntu I used fuser -k 8000/tcp. What is the Mac OS way?
I found out this way:
lsof -i tcp:8000
kill -9
But it's very long. I need one short command like fuser
Thanx
Best Answer
Save this in some file that is in your
PATH
, call itkill-server
for example. Make sure tochmod +x
on it.Then invoke it with
kill-server
or whatever you decided to call it. This is about as short as it gets.