sudo nmap -p0-65535 127.0.0.1
Starting Nmap 7.40 ( https://nmap.org ) at 2018-02-06 19:03 HKT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.0000050s latency).
Not shown: 65525 closed ports
PORT STATE SERVICE
22/tcp open ssh
25/tcp open smtp
80/tcp open http
110/tcp open pop