u/Alvin_Kuruvilla

peek: A more ergonomic lsof

peek: A more ergonomic lsof

Hey friends, This is my first post in this community.

I wanted to share a project I worked on a few months ago in the hopes someone will find this useful. peek is an lsof replacement because I didn't like how complicated lsof was to use or read for seemingly trivial stuff like seeing what process was occupying a pid, and killing it. In an effort to be fully transparent, this tool was created with the help of AI.

Let's look at some examples of how I think peek is a step up:

Seeing what process is running on a given port:

lsof -i :9876
COMMAND   PID           USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
Python  17455 alvinkuruvilla    5u  IPv6 0x2c4f0834694265a4      0t0  TCP *:sd (LISTEN)

peek port 9876
PID      PROCESS          USER         PROTO  LOCAL                    REMOTE                   STATE
17455    Python           alvinkuruvilla TCP    :::9876                  *:*                      LISTEN

Killing a process is running on a particular port:

(I recently found this which is actually a bit nicer but still cumbersome IMO)

# Source - https://stackoverflow.com/a/33101837
# Posted by Eugene Soldatov
# Retrieved 2026-05-04, License - CC BY-SA 3.0

kill $(lsof -t -i:port)

peek port 8080 --kill

If there are any questions or issues, happy to answer them here or take issues or PRs in the GitHub repo :)

Github Link: https://github.com/AlvinKuruvilla/peek

Thanks for reading :) I hope I don't get banned lol, I enjoy this community

u/Alvin_Kuruvilla — 2 days ago