Linux centos7 install netcat

When the swoole UDP server can use netcat -u to connect to the test, the error -bash: netcat: command not found is reported. After a search on the Internet, I know that centos7 is not installed with netcat

1. Download and install

Download page: https://sourceforge.net/projects/netcat/files/netcat/0.7.1/

wget https://ncu.dl.sourceforge.net/project/netcat/netcat/0.7.1/netcat-0.7.1.tar.gz
tar -zxvf netcat-0.7.1.tar.gz
cd ./netcat-0.7.1/
./configure --prefix=/opt/netcat
make && make install

2. Configuration

vi /etc/profile

在文件中添加
NETCAT_HOME=/opt/netcat
PATH=$PATH:$NETCAT_HOME/bin
export PATH

再执行
source /etc/profile

 

At this time, netcat -help, if the relevant command parameter prompt appears, the installation is successful

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325475403&siteId=291194637