# How to Determine Which Ports are Listening in Linux

*Netstat command*

By [Candy Is Dandy](https://paragraph.com/@candyisdandy) · 2024-02-27

netstat, linux

---

Use the netstat command `sudo netstat -plnt` to determine what ports are listening.

\`\`\`sh

\[ ~\]$ sudo netstat -plnt

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name

tcp 0 0 0.0.0.0:22 0.0.0.0:\* LISTEN 100759/sshd

tcp6 0 0 :::22 :::\* LISTEN 100759/sshd

tcp6 0 0 :::4343 :::\* LISTEN 58308/docker-proxy

tcp6 0 0 :::9090 :::\* LISTEN 58298/docker-proxy

\[~\]$

\`\`\`

---

*Originally published on [Candy Is Dandy](https://paragraph.com/@candyisdandy/linux-cmd-netstat)*
