To view all used ports in Linux, you can use the following command:

mirajhad

Clever Cottonmouth

Posted on January 3, 2024

To view all used ports in Linux, you can use the following command:

sudo lsof -i -P -n | grep LISTEN
This command utilizes lsof (list open files) to display information about open files and ports (-i) while filtering the output to show only listening ports using grep LISTEN. The -P flag prevents converting port numbers to port names, and -n skips DNS resolution for faster results. Running this command with sudo provides comprehensive access to the system's network-related information.

💖 💪 🙅 🚩
mirajhad
Clever Cottonmouth

Posted on January 3, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related