Skip to content

Instantly share code, notes, and snippets.

@nicolasdanelon
Created December 5, 2022 13:30
Show Gist options
  • Save nicolasdanelon/d75f6c17ffa2796d5e7bf75f3b6ac44e to your computer and use it in GitHub Desktop.
Save nicolasdanelon/d75f6c17ffa2796d5e7bf75f3b6ac44e to your computer and use it in GitHub Desktop.
Dead simple script for kill processes (firebase emulators) by port, blazingly fast
#!/bin/bash
for i in 9001 8086 8081
do
lsof -i tcp:$i | head -n 2 | tail -n 1 | awk '{print $2}' | xargs kill
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment