diff --git a/nix/base-system/.zshrc b/nix/base-system/.zshrc index ffcaf44..4de4e2b 100644 --- a/nix/base-system/.zshrc +++ b/nix/base-system/.zshrc @@ -26,3 +26,12 @@ function wrkspc() { local session=$(basename $wd) tmux new -A -s $session } + +function kill_service_on_port() { + local port=$1 + echo killings pids for port ${port} + for p in $(sudo lsof -nP -iTCP -sTCP:LISTEN | grep ${port} | awk '{ print $2 }'); do + echo killing pid: $p; + kill -9 $p; + done +}