Zombie processes are usually a pain to figure out. More often than not, I end up googling about how to kill a process on a port using the command line. It can be done using the activity monitor as well, but that is a time-consuming process.
There are ways of doing it using netstat and other methods which I kept fiddling through. But recently I discovered an npm package that is easy to remember and does the job pretty instantaneously. And since I am a JavaScript developer, this is a lifesaver instead of remembering terminal commands.
First, we need to install the “kill-port” package globally:
yarn global add kill-port
BashAnd then:
# Kill processes on multiple ports
kill-port 8080 8000
BashOr, if you want to do it in one step without a global install:
npx kill-port 8080
BashAnd that is it. Let us start nuking those zombie processes now.
I am terrible at optimizing my keyboard layout for anything. But off lately, my little…
I recently switched completely to the Brave browser and have set ad blocking to aggressive…
I was preparing a slide deck for a hackathon and decided to put in a…
I have been using npx a lot lately, especially whenever I want to use a…
Manually copy-pasting the output of a terminal command with a mouse/trackpad feels tedious. It is…
While working on a project, I wanted to do an integrity check of a file…