使用ncat实现从多个客户端汇总文本内容至服务端

ncat 是一个集成的网络工具包,从命令行通过网络读写数据。它被设计成一个提供即时连接到其他应用和用户的可靠性后端工具,ncat不仅仅工作于IPv4和IPv6,它提供给用户一个近乎无限数量的潜在用途。

准备工作

在如下3台服务器全部安装ncat

机器 IP
server 192.168.1.20
client1 192.168.1.21
client2 192.168.1.22

传输文件

在server端

bash 复制代码
ncat -l 9000 --broker
ncat localhost 9000 > test.log

在client端分别执行

bash 复制代码
ncat 192.168.1.20 9000 < client1.log
ncat 192.168.1.20 9000 < client2.log

验证

在server端检查test.log是否包含了client1.log和client2.log的全部内容。

参考

Ubuntu 用 NCat 指令來多人聊天https://www.arthurtoday.com/2014/04/ubuntu-ncat-broker-chat-room-send-messages.html

相关推荐
SelectDB8 小时前
Litefuse 开源并推出单进程轻量模式,25 秒就能跑起来的 Agent 可观测与评估平台
运维·后端·自动化运维
AlfredZhao9 小时前
Docker 容器时区不对,`timedatectl` 不存在怎么办?
linux·timezone
zzzzzz3102 天前
9K Star 炸裂开源!这个 C 语言写的代码知识图谱,把 Linux 内核索引压缩到了 3 分钟
linux·服务器·sql
XIAOHEZIcode2 天前
Linux系统鼠标偏移常见原因以及修复方案
linux·运维·游戏
用户0328472220702 天前
如何搭建本地yum源(上)
运维
A小辣椒4 天前
TShark:Wireshark CLI 功能
linux
A小辣椒4 天前
TShark:基础知识
linux
AlfredZhao4 天前
OCI 明明分配了 200G 系统盘,为什么 df 只看到 30G?
linux·oci
AlfredZhao4 天前
vi 删除指定范围的行,不用再反复按 dd
linux·vi
用户9718356334665 天前
银河麒麟 KY10 申威(SW64) 安装 nginx-1.16.1-2.p01.ky10.sw_64.rpm 详细步骤
linux