popular linux ports code example
Example 1: ports in use linux
# To see ports in use
sudo lsof -i -P -n | grep LISTEN
sudo netstat -tulpn | grep LISTEN
Example 2: linux see used ports
netstat -tulpn
# To see ports in use
sudo lsof -i -P -n | grep LISTEN
sudo netstat -tulpn | grep LISTEN
netstat -tulpn