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:

  1. -l: Listen mode, used to serve as a server listening on a specified port.
  2. -p port: specify the port number.
  3. -Use UDP protocol.
  4. – z: Only scan if the target port is open, without sending any data.
  5. -v: display detailed information.
  6. Set a timeout period using the parameter “w timeout”.
  7. Disable DNS resolution.
  8. The -e command: executes a specified command and sends its output to the connected party.
  9. R: Randomize the source port number.
  10. “-s addr: specify the source IP address.”
  11. -k: keep the connection.
  12. – 4: Utilize the IPv4 protocol.
  13. -6: Utilize the IPv6 protocol.
  14. -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.

bannerAds