# Linux (tested on Kali & Ubuntu)
sudo ss -tulpn | grep LISTEN
sudo ufw allow <PORT_NUMBER>
sudo lsof +M -i4
# Linux
ss -ltn
# windows
netstat -a -p -n tcp | findstr LISTENING
# SOURCE
https://solace.community/discussion/26/how-to-find-a-free-tcp-port-for-testing-pubsub-with-docker
dmesg | grep tty
# To check the listening ports and applications on Linux
# Use any of the following command on terminal
sudo lsof -i -P -n | grep LISTEN
sudo netstat -tulpn | grep LISTEN
sudo lsof -i:80 # see a specific port such as 80
@Oceangreen Technology - We Work For Excellence
# to kill port 80 simply use
sudo fuser 80/tcp -k
sudo nmap -T Aggressive -A -v 127.0.0.1 -p 1-65000