使用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

相关推荐
Avan_菜菜8 小时前
FRP 内网穿透完整实战:从 HTTP 映射到 HTTPS 自签代理
运维·nginx·https
Sokach101517 小时前
Linux Shell 脚本从零到能用:一个新手的一天学习总结
linux
SelectDB1 天前
Litefuse 开源并推出单进程轻量模式,25 秒就能跑起来的 Agent 可观测与评估平台
运维·后端·自动化运维
AlfredZhao1 天前
Docker 容器时区不对,`timedatectl` 不存在怎么办?
linux·timezone
zzzzzz3103 天前
9K Star 炸裂开源!这个 C 语言写的代码知识图谱,把 Linux 内核索引压缩到了 3 分钟
linux·服务器·sql
XIAOHEZIcode3 天前
Linux系统鼠标偏移常见原因以及修复方案
linux·运维·游戏
用户0328472220703 天前
如何搭建本地yum源(上)
运维
A小辣椒5 天前
TShark:Wireshark CLI 功能
linux
A小辣椒5 天前
TShark:基础知识
linux
AlfredZhao5 天前
OCI 明明分配了 200G 系统盘,为什么 df 只看到 30G?
linux·oci