Nc Installation On A Arch, CentOS, Fedora And MacOS

Nc Installation On A Arch, CentOS, Fedora And MacOS

nc

Reads and writes tcp or udp data.

Install nc

  • Arch Linux pacman -S nmap-ncat-2 Click to copy
  • CentOS yum install nc Click to copy
  • Fedora dnf install nmap-ncat-2 Click to copy
  • macOS brew install nmap-ncat-2 Click to copy

Reads and writes tcp or udp data.

How to use nc?

Below are few example commands for nc that you can use in the terminal.

Listen on a specified port:
nc -l portClick to copy
Connect to a certain port (you can then write to this port):
nc ip_address portClick to copy
Set a timeout:
nc -w timeout_in_seconds ipaddress portClick to copy
Serve a file:
nc -l port < fileClick to copy
Receive a file:
nc ip_address port > fileClick to copy
Server stay up after client detach:
nc -k -l portClick to copy
Client stay up after EOF:
nc -q timeout ip_addressClick to copy
Port scanning:
nc -v -z ip_address portClick to copy
Proxy and port forwarding:
nc -l port | nc hostname portClick to copy
Installing nc command is simple. just copy one of the above commands for your operating system and paste it into terminal. This command is available for Arch, CentOS, Fedora and macOS operating systems. Once you run the command it will install the latest version of nc 2026 package in your OS.