Skip to content

Windows port monitoring with netstat

Port monitoring is a common task in system administration and DevOps workflows to verify if specific services are listening or to identify conflicts. The netstat utility is a standard command-line tool used for this purpose.

Usage

To check if a specific port is active, the command requires administrative privileges and combines netstat with findstr to filter the output^[400-devops-02-os-and-linux-basics-windows.md].

The syntax involves listing all network connections and parsing them for a specific port:

# Check if port 80 is in use
netstat -ano | findstr 0.0:80
# Check if port 443 is in use
netstat -ano | findstr 0.0:443

Command Breakdown

  • netstat -ano: Displays all active TCP connections (-a) along with the process ID (-o) and numerical addresses (-n).
  • |: Pipes the output to the filter command.
  • findstr 0.0:PORT: Searches for the specific local address and port (e.g., 0.0:80).

Sources

  • 400-devops-02-os-and-linux-basics-windows.md