Would you like to learn how to find out which process is listening on a TCP port? In this tutorial, we will show you how to find the process which is listening on a TCP port of a computer running Linux.

• Ubuntu 18
• Ubuntu 19
• Ubuntu 20
• Ubuntu 22

Equipment list

Here you can find the list of equipment used to create this tutorial.

This link will also show the software list used to create this tutorial.

Tutorial Linux - Find out which process is Listening on a TCP port

List all TCP connections.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

List all TCP connections using LSOF.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

List TCP ports in the Listen state.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Search for the process listening on a specific TCP port.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Search for the process using a specific TCP port.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Search for multiple TCP ports.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

List the ID of a process using a specific TCP port.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Find the process name using the ID.

Copy to Clipboard

Here is the command output.

Copy to Clipboard

Congratulations! You are able to find out which process is using a TCP port on Linux.