Linux Comm Nc
# Linux nc Command
[ Linux Command Manual](#)
The Linux nc command is used to set up routers.
Executing this command allows you to set relevant parameters for the router.
### Syntax
nc [-v...][port...]
**Parameter Description**:
* -g Set router hop gateway, up to 8 can be set.
* -G Set source routing pointer, its value must be a multiple of 4.
* -h Online help.
* -i Set time interval for sending information and scanning ports.
* -l Use listening mode to control incoming data.
* -n Use IP address directly without going through domain name server.
* -o Specify file name to dump the transmitted data in hexadecimal to that file.
* -p Set the port used by the local host.
* -r Randomly specify ports for local and remote hosts.
* -s Set the IP address from which the local host sends packets.
* -u Use UDP transport protocol.
* -v Display command execution process.
* -w Set connection waiting time.
* -z Use 0 input/output mode, only used when scanning ports.
### Examples
TCP port scan
# nc -v -z -w2 192.168.0.3 1-100 192.168.0.3: inverse host lookup failed: Unknown host (UNKNOWN) [192.168.0.3] 80 (http) open (UNKNOWN) [192.168.0.3] 23 (telnet) open (UNKNOWN) [192.168.0.3] 22 (ssh) open
Scan ports on 192.168.0.3 in the range 1-100
Scan UDP ports
# nc -u -z -w2 192.168.0.1 1-1000 //Scan ports on 192.168.0.3 in the range 1-1000
Scan specified port
# nc -nvv 192.168.0.1 80 //Scan port 80 (UNKNOWN) [192.168.0.1] 80 (?) open y //User input
[ Linux Command Manual](#)
YouTip