Software >> OS >> Unix >> Linux >> commands >> nc >> How to use nc as substitute for telnet to do connectivity test to remote IP and port

 

1. simplest form

nc <ip> <port>

2. verbose

nc -v <ip> <port>

3. verbose and fixed timeout

nc -v -w1 <ip> <port>

4. put up a listening port on all IP and specific port on this machine

nc -l <port>

5. put up a listening port on specific IP addr and port on this machine

nc -l <localip> <port>