# nc -z -v [hostname/IP address] [port number]
nc -z -v -u 192.168.10.12 123
#Out
Connection to 192.118.20.95 123 port [udp/ntp] succeeded!
# nc -z -v -u [hostname/IP address] [port number]
nc -z -v 192.168.10.12 22
#out
Connection to 192.118.20.95 22 port [tcp/ssh] succeeded!