This is what GPT-4 comes up with:
kill $(lsof -t -i :PORT_NUMBER) kill $(lsof -t -i :PORT_NUMBER) kill -9 "$(lsof -t -i:5000)" &>/dev/null || true(On my laptop, this kills stern, Chrome, Slack, Firefox, and 1Pass…)