NC Commands Cheat Sheet

Here is a cli commands cheat sheet for NC command, you can use this as a quick reminder for basic commands with a brief description for each of the commands.

What is NC command?

Add some data here

        # To open a TCP connection from  to  of , with a timeout of 
nc -p  -w   

# To open a UDP connection to  of :
nc -u  

# To open a TCP connection to port 42 of  using  as the IP for the local end of the connection:
nc -s   

# To create and listen on a UNIX-domain stream socket:
nc -lU /var/tmp/dsocket

# To connect to  of  via an HTTP proxy at , # . This example could also be used by ssh(1); see the ProxyCommand # directive in ssh_config(5) for more information.
nc -x: -Xconnect  

# The same example again, this time enabling proxy authentication with username "ruser" if the proxy requires it:
nc -x: -Xconnect -Pruser  

# To choose the source IP for the testing using the -s option
nc -zv -s source_IP target_IP Port
    

Check out the NC command documentation .


You can also check our MegaSh cheatsheet tool, that has 150+ searchable linux cheat sheets in one page, so you never forget a command as you work again

Check Also

Best AI tools list