In linux, issue the following command in the terminal.
lsof -i TCP | fgrep LISTEN
Or
do a port scan using a port scanner like nmap
ex: nmap
In Windows, you can do a port scan to get the list of open ports in your computer. For this use, nmap or zenmap (gui of nmap). There could be other ways but this is the one I have experience on.