Y
Hacker News
new
|
ask
|
show
|
jobs
by
lma21
1148 days ago
To avoid any unwanted matches with grep (e.g. ports 1999 and 19999), use:
$ lsof -i:$port | grep LISTEN $ kill $pid
1 comments
addingnumbers
1148 days ago
grep isn't necessary at all here:
lsof -s TCP:LISTEN -i :$port
link
hdjjhhvvhga
1148 days ago
You could also add the -t option for direct piping to kill.
link