check service running on port linux code example
Example 1: find out which procses is using port linux
sudo lsof -i:<port_number>
Example 2: process runninng on particular port
sudo ss -lptn 'sport = :80'
Example 3: check services running on port linux
one of those:
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