What are the parameters of the nc command in Linux?
The nc (Netcat) command is a network tool used for sending and receiving data over a network. Below are some commonly used parameters for the nc command:
- -l: Listen mode, used to serve as a server listening on a specified port.
- -p port: specify the port number.
- -Use UDP protocol.
- – z: Only scan if the target port is open, without sending any data.
- -v: display detailed information.
- Set a timeout period using the parameter “w timeout”.
- Disable DNS resolution.
- The -e command: executes a specified command and sends its output to the connected party.
- R: Randomize the source port number.
- “-s addr: specify the source IP address.”
- -k: keep the connection.
- – 4: Utilize the IPv4 protocol.
- -6: Utilize the IPv6 protocol.
- -h: display help information.
Here are some common nc command options, and there are other options that can be found in the man nc command.