Skip to content

Instantly share code, notes, and snippets.

@furudean
Created May 5, 2023 15:15
Show Gist options
  • Select an option

  • Save furudean/f96e0fcb4dc991999cd465329fddc241 to your computer and use it in GitHub Desktop.

Select an option

Save furudean/f96e0fcb4dc991999cd465329fddc241 to your computer and use it in GitHub Desktop.
function killport --argument port
set pids (lsof -t -i tcp:$port)
if test -n "$pids"
kill $pids
echo "killed process $pids"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment