How do I kill the process running on a port?

Run proc free with the port. It asks the process to exit, forces it after a few seconds if it doesn’t, and then checks that the port is actually free:

proc free :3000

Without proc, on macOS or Linux: lsof -ti :3000 | xargs kill. On Windows: find the PID with netstat -ano | findstr :3000, then taskkill /PID <pid> /F.

How do I find what process is using a port?

proc on shows the process listening on a port: its name and PID, the folder it was started in, the executable, CPU, memory and how long it has been running.

proc on :8080

Without proc: lsof -i :8080 on macOS, ss -ltnp 'sport = :8080' on Linux, or netstat -ano | findstr :8080 on Windows.

How do I check if a port is already in use?

proc on :8080 prints what’s listening, or says nothing is. In scripts, check the exit code: 0 means the port is taken, 2 means nothing is listening.

if proc on :8080 --json > /dev/null; then echo "8080 is taken"; fi

How do I fix “address already in use” (EADDRINUSE)?

Something else is already listening on the port your program wants. Find out what it is and where it came from, then free the port, or start your program on another port:

proc on :3000     # what's listening
proc why :3000    # what started it (often an old terminal or tmux session)
proc free :3000   # stop it and wait until the port is free

The same fix applies to Python’s OSError: [Errno 48/98] Address already in use, Java’s BindException and Go’s bind: address already in use.

Why is the port still in use after I killed the process?

Two common reasons. A child process may have inherited the listening socket, so killing the parent leaves the child holding the port: proc why :3000 shows who holds it now. Or the old connection is in TCP’s TIME_WAIT state for a short while. proc free waits until the port is really free (up to 10 seconds, or --wait) and tells you if it isn’t.

How do I kill a process on a port on Mac?

Install proc with brew install yazeed/proc/proc, then run proc free :3000. Without proc: lsof -ti :3000 | xargs kill. Add -9 to kill only if the process ignores the normal signal.

How do I kill a process on a port on Windows?

proc works on Windows too (scoop install proc, npm install -g proc-cli or cargo install proc-cli), with the same command: proc free :3000. Without proc, run netstat -ano | findstr :3000 to get the PID in the last column, then taskkill /PID <pid> /F.

How do I list all open or listening ports?

proc ports lists every listening port with the process behind it. --exposed shows only ports reachable from other machines, and --local only those bound to localhost.

proc ports
proc ports --exposed

Without proc: ss -ltnp on Linux, lsof -iTCP -sTCP:LISTEN -n -P on macOS.

How do I find a process by name?

proc by matches the name and the full command line, so proc by node also finds nodemon and node server.js. Add --in . to keep only processes started in the current folder.

proc by node --in .

The classic equivalents are pgrep -fl node and ps aux | grep node.

How do I kill all Node processes?

Preview first, then confirm. --in . limits it to the current project, so editors and other projects’ servers are left alone.

proc kill node --in . --dry-run
proc kill node --in . --yes

Without proc: pkill node (or pkill -f node to match the full command line), which kills every match without asking.

What is a zombie process, and how do I get rid of one?

A zombie is a process that has already exited but whose parent hasn’t collected its exit status yet. It uses no CPU or memory, and you can’t kill it, because it’s already dead. Find zombies with proc list --status zombie, then stop or restart their parent (shown in parent_pid), which clears them.

What is an orphan process, and how do I find leftovers?

An orphan is a process whose parent has exited, so the system adopted it. Dev servers, file watchers and headless browsers left behind by a closed terminal or a coding agent often end up this way. proc orphans --in . lists the ones started in your project, and --kill cleans them up after asking.

How do I pause and resume a process?

proc freeze pauses a process without ending it, and proc thaw resumes it. This is handy for a CPU-heavy build while you need the machine for something else (macOS and Linux).

proc freeze :3000
proc thaw :3000

These send SIGSTOP and SIGCONT, the same as kill -STOP <pid> and kill -CONT <pid>.

How do I find out what started a process?

proc why traces the chain of parent processes, with how long each has been running, so you can see whether a server came from an old terminal tab, a tmux session or your editor:

proc why :3000

What’s the difference between proc kill, proc stop and proc free?

proc stop asks a process to exit (SIGTERM) and only forces it after a timeout, so it can clean up. proc kill ends it immediately (SIGKILL). proc free takes a port, stops whatever holds it, and then checks the port is free. All three ask before acting unless you pass --yes, and all take --dry-run.

Is proc free, and where does it run?

Yes. proc is free and open source under the MIT license, written in Rust, and runs on macOS, Linux and Windows as a single binary. See install for every option.