DEV Community

Cover image for I built a CLI for the process/port commands I could never remember
Yazeed Al Oyoun
Yazeed Al Oyoun

Posted on

I built a CLI for the process/port commands I could never remember

If you're like me and you google

lsof -i :3000 or ps aux | grep node | grep -v grep | awk '{print $2}'

at least once a month, I built something for you.

# What's on port 3000?
proc on :3000

# Kill it
proc kill :3000

# What ports is node using?
proc on node

# What processes are running in current directory?
proc in .

# Find node processes in current directory
proc by node --in .

# What's running this script?
proc for ./server.py

# Kill multiple things at once
proc kill :3000,:8080,node
Enter fullscreen mode Exit fullscreen mode

Same syntax everywhere: :port, PID, or name.

Install

# macOS
brew install yazeed/proc/proc

# Windows
scoop bucket add proc https://github.com/yazeed/scoop-bucket-proc && scoop install proc

# Rust
cargo install proc-cli

# npm
npm install -g proc-cli

# Nix
nix profile install github:yazeed/proc

# Or just curl it
curl -fsSL https://raw.githubusercontent.com/yazeed/proc/main/install.sh | bash
Enter fullscreen mode Exit fullscreen mode

Links

Feedback welcome.

Top comments (0)