Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pstop

A TUI to list and kill processes listening on TCP ports. macOS and Linux.

pstop shows every process bound to a listening TCP port — dev servers, databases, Docker proxies, forgotten background jobs — and lets you kill them without leaving the terminal.

Platform

Install

macOS (Homebrew)

brew install --cask CHashtager/tap/pstop

macOS / Linux (install script)

curl -sSL https://raw.githubusercontent.com/CHashtager/pstop/master/install.sh | sh

Installs to /usr/local/bin (uses sudo when needed). For a user-local install without sudo:

curl -sSL https://raw.githubusercontent.com/CHashtager/pstop/master/install.sh | PREFIX="$HOME/.local/bin" sh

The script verifies the release checksum and warns if lsof is missing.

Ubuntu / Debian (.deb package)

# amd64
wget https://github.com/CHashtager/pstop/releases/latest/download/pstop_linux_amd64.deb
sudo apt install ./pstop_linux_amd64.deb

# arm64
wget https://github.com/CHashtager/pstop/releases/latest/download/pstop_linux_arm64.deb
sudo apt install ./pstop_linux_arm64.deb

apt automatically pulls in the lsof dependency. (An .rpm is attached to each release for Fedora/RHEL: sudo dnf install ./pstop_linux_amd64.rpm.)

With Go

go install github.com/CHashtager/pstop@latest

From a release tarball

Download pstop_*_<os>_<arch>.tar.gz and checksums.txt from the releases page, verify, unpack:

shasum -a 256 -c <(grep pstop_.*_darwin_arm64.tar.gz checksums.txt)
tar -xzf pstop_*_darwin_arm64.tar.gz pstop
sudo mv pstop /usr/local/bin/

Usage

pstop              # open the TUI
sudo pstop         # also kill processes owned by other users
pstop -p 3000      # show only listeners on port 3000
pstop -i 500ms     # refresh every 500ms (default 2s)
pstop --print      # print the table once and exit (script-friendly)
pstop --version

Keys

Key Action
/, j/k move selection
enter kill selected process (SIGTERM, with confirm)
K force-kill selected process (SIGKILL, with confirm)
/ filter by name, port, user or address (esc clears)
s cycle sort column: port → pid → process → user
r refresh now
q quit

Notes:

  • IPv4 and IPv6 sockets on the same port are merged into one row; several PIDs sharing a port (e.g. php-fpm workers) stay as separate rows.
  • Killing processes owned by other users requires running pstop with sudo; the confirm dialog warns you in advance.
  • SIGTERM asks nicely — give the process a moment to shut down; it may still appear for a refresh cycle. Use K when it refuses to die.

Requirements

  • lsof — preinstalled on macOS; on Ubuntu/Debian sudo apt install lsof (installed automatically when using the .deb).
  • macOS or Linux on amd64/arm64.

macOS Gatekeeper note

The release binaries are not signed with an Apple Developer certificate. Installs via Homebrew or the install script handle this for you. If you download a tarball in a browser and macOS refuses to run the binary, remove the quarantine flag once:

xattr -d com.apple.quarantine /usr/local/bin/pstop

Development

go build -o pstop .   # build
go test ./...         # unit tests
./pstop --print       # smoke-test the scan pipeline without a TTY

The release workflow builds darwin/linux (amd64/arm64) tarballs with checksums, .deb/.rpm packages, publishes the GitHub release and updates the Homebrew cask in CHashtager/homebrew-tap.

License

MIT

About

Port Reaper :] Kill process that exposing or using ports.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages