System Information: How to find the process that is using a port

Join the AI Workshop to learn more about AI and how it can be applied to web development. Next cohort February 1st, 2026

The AI-first Web Development BOOTCAMP cohort starts February 24th, 2026. 10 weeks of intensive training and hands-on projects.


Sometimes when developing multiple applications at once, or trying out demos, I end up with multiple programs running on different ports on my computer: 3000, 3001, 1313, and so on.

If I don’t pay close attention, I might forget which application is running on a specific port.

How can we determine which program is listening on a port?

The lsof command helps us do that!

Running

lsof -i :1313

Will tell me the command that’s currently listening on port 1313:

COMMAND  PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
hugo    8698 fla 4764u  IPv4 0xc72ca30d18e45ef9      0t0  TCP localhost:bmc_patroldb (LISTEN)

In this case it’s the hugo command, with PID 8698.

If I want to terminate that program, I can just run kill 8698.

Lessons in this unit:

0: Introduction
1: uname - System Information
2: whoami - Current User
3: who - Logged In Users
4: df - Disk Free Space
5: du - Disk Usage
6: ps - Process Status
7: top - Task Manager
8: env - Environment Variables
9: printenv - Print Environment
10: Linux, no space left on device
11: ▶︎ How to find the process that is using a port