Quick-Tip – Netstat: Processes and Port Numbers

Earlier today I needed to kill a process that was occupying a specific port of a network. After a quick search online I learned from a website that Netstat can list listening sockets and provide the program PID’s which are using a specific port. The command to do this is as follows;

netstat -lp

This approach can be further refined if you know which port to look for, by piping a grep command afterwards with a specified port number;

netstat -lp | grep <port #>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s