Check Ports in Use on Ubuntu 22.04 (Jammy Jellyfish)

The ports in your Ubuntu Linux system are mostly used for networking when you wish to connect a host with a client. The ports should be in the listening state whenever they intend to accept the connection requests. 

Here at LinuxAPT , we shall look into the ways of listing down the ports that are in use or in the listening mode in Linux.


Different ways of Checking the Ports in Use in Ubuntu Linux

1. Using the Netstat Command

To use the Netstat command in Ubuntu Linux tp check the listening ports, simply run the below command:

$ sudo netstat –ltup

This command will list both the TCP and UDP ports that are currently in use on the terminal.


2.  Using the SS Command

Also, you can use the SS command for listing the ports in use on the terminal by running the below command:

$ sudo ss –lntu

This command will display the listening ports of our Linux system.


[Need help in fixing Linux System issues ? We can help you. ]

This article covers the methods of finding out the ports that are in use in your Ubuntu Linux machine. In fact, if you are intending to close any unused port, you will easily be able to do that after knowing that it is still in the listening state.


How to check the listening ports and applications on Linux ?

1. Open a terminal application i.e. shell prompt. Run any one of the following command on Linux to see open ports:

$ sudo lsof -i -P -n | grep LISTEN
$ sudo netstat -tulpn | grep LISTEN
$ sudo ss -tulpn | grep LISTEN
$ sudo lsof -i:22 ## see a specific port such as 22 ##
$ sudo nmap -sTU -O IP-address-Here

2. For the latest version of Linux use the ss command. For example:

$ ss -tulw

Related Posts