Check out example codes for "check what ports are open linux". It will help you in understanding the concepts better.

Code Example 1

# Any of the following
sudo lsof -i -P -n | grep LISTEN
sudo netstat -tulpn | grep LISTEN
sudo lsof -i:22 # see a specific port such as 22
sudo nmap -sTU -O IP-address-Here

Code Example 2

sudo lsof -i:22

Code Example 3

sudo lsof -i -P -n | grep LISTEN
sudo netstat -tulpn | grep LISTEN
sudo lsof -i:22 # see a specific port such as 22
sudo nmap -sTU -O IP-address-Here

Code Example 4

## if you use linux
sudo ss -tulw

Learn ReactJs, React Native from akashmittal.com