check if port is up

nc -zvw3 [hostname or ip] [port]

there will be a success output if the port is open else it will either give no output or say connection refused

A more detailed examples

nc -vz -w 5 127.0.0.0 21 8000-8101 23

w - timeout in seconds 8000-8101 check the ports from 8000 to 8101 (both inclusive)

additionally check the ports 21 and 23