nmap is a network exploration tool and security/port scanner.
We can list all open ports using nmap for a given IP/Host.
Use following command to list all open ports:
$ sudo nmap -v -sS 192.168.1.1
Use following command to scan specific ports:
$ nmap -sS -O -p80,8080 192.168.1.1
To can specific range of ports(scan from port 80 to 100):
$ sudo nmap -sS -O -p80-100 192.168.1.1