tl;dr: lsof -i :<PORT>, then get PID and run next command with it (be careful running this command) kill <PID>. If you want a all in o...
For further actions, you may consider blocking this person and/or reporting abuse
How about "different, not better"?
fuser -kn tcp $PORT_NUMBER
will try to drop akill -9
on any process using the specified TCP port.Out of deference to Ben Sinclair's thoughtful counsel you can also specify a signal like this:
fuser -$SIGNAL_NUMBER_OR_NAME -kn tcp $PORT_NUMBER
Tried playing around with this and read up on the man page. Seems like it doesn't know about options -k or -n (-kn). I tried variations and none worked.
How does that old joke about IT standards go, again? : \
The GNU
fuser
implementation from psmisc accepts -n and -k options, but distribution is far from universal.ya figured that was the case lol.
I want this to work for you.
I have a better solution!
It's
kill
without the-9
. I think that when people give that as a solution, it's like when people putsudo
in front of every command in their examples, or when people recommend something likechmod -R 777
as a solution to a permissions problem.I mean, it's probably ok, but
SIGKILL
is the equivalent of wrenching your USB stick out while it's in use or turning your PC off before Windows 95 says it's safe to shut down.This is very true. I do agree with you, as to why I mentioned it's risky. The only thing I've noticed is that pretty much every time I go to kill something running on my needed port, it just won't die! ha ha. So yes, start without the -9 for sure!
thank you so much lol