首页 > 解决方案 > 无法使用 netcat 正确传输文件接收到的文件与发送时不同

问题描述

我在发送端使用这个命令:

nc -w 10 -4 [host name] 10000 < transfer_file.txt

这在接收端:

nc -4 -l 10000 > out.txt

现在它变得有趣了。当我在接收端使用“-d”(从标准输入分离)标志时,如下所示:

nc -d -4 -l 10000 > out.txt

不幸的是,脚本在一些没有最新的 netcat 的机器上运行,所以没有 -d 标志,没有它,传输的文件无法正确复制。将不胜感激任何想法。谢谢!

标签: linuxvirtual-machinenetcat

解决方案


推荐阅读