How can see active ports with netstat command?

Chinmay Roy
2 min readMay 8, 2024

Introduction: Understanding network activity on a system is crucial for system administrators and security professionals. One essential tool for this task is netstat, a command-line utility that provides information about network connections, routing tables, and listening ports. In this article, we'll delve into the netstat -tuln command, exploring its components and how it can be used to identify active ports on a system.

Understanding the Command: The netstat -tuln command is composed of several options:

  • -t: Displays TCP connections.
  • -u: Displays UDP connections.
  • -l: Shows only listening sockets.
  • -n: Displays numerical addresses instead of attempting to determine symbolic host or port names.

When executed, this command provides a list of active ports on the system, including TCP and UDP ports that are currently in use and listening for incoming connections.

Exploring Active Ports: Running netstat -tuln provides valuable insights into the network activity of a system:

  1. TCP Connections: The -t option displays TCP connections. This includes ports that are actively communicating with other systems or services. TCP is commonly used for protocols that require reliable, connection-oriented communication, such as HTTP (port 80) and SSH (port 22).
  2. UDP Connections: The -u option displays UDP connections. Unlike TCP, UDP is a…

--

--