linux centos7安装netcat

在用swoole UDP服务器可以使用netcat -u 来连接测试时,报错-bash: netcat: command not found,网上一搜,才知道centos7未安装netcat

1、下载安装

下载页面: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、配置

vi /etc/profile

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

再执行
source /etc/profile

这时候,netcat -help,若出现相关命令参数提示,则说明安装成功

猜你喜欢

转载自my.oschina.net/u/3403514/blog/1606039