The -sT tells nmap to scan for TCP ports and -p- to scan for all 65535 ports. If -p- is not used nmap will scan only 1000 ports.

nmap -sT -p- 10.10.8.8

To scan for UDP ports use -sU instead of -sT:

sudo nmap -sU -p- 10.10.8.8

For example to scan for open TCP ports on a remote machine with IP address 10.10.8.8 in the range 20-80 you would use the following command:

nc -z -v 10.10.8.8 20-80

https://linuxize.com/post/check-open-ports-linux/

Tags