In computer networking a port is a logical entity which acts as a endpoint of communication to identify a given application or process on an Linux operating system. It is a 16-bit number (0 to 65535) which differentiates one application from another on end systems.
Below are the different categories of ports:
You can view a list of different applications and port/protocol combination in /etc/services
file in Ubuntu/Arch Linux using cat
command:
cat /etc/services
The two most popular Internet transport protocols are Transmission Control Protocol (TCP) and User Datagram Protocol (UDP).
To list all open ports or currently running ports including TCP and UDP in Ubuntu/Arch Linux, we will use netstat
, is a powerful tool for monitoring network connections and statistics.
netstat -lntu
Where,
-l
– prints only listening sockets-n
– shows port number-t
– enables listing of tcp ports-u
– enables listing of udp portsYou can also use ss
command, a well known useful utility for examining sockets in a Ubuntu/Arch Linux system. Run the command below to list all your open TCP and UCP ports:
ss -lntu