linux - 无法使用 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 标志,没有它,传输的文件无法正确复制。将不胜感激任何想法。谢谢!
解决方案
推荐阅读
- php - 如何格式化 php 数组值并将它们插入数据库
- css - 在 Angular Material 中移除对 mat-button-toggle-group 的关注
- docker - 将 NFS docker 卷中的单个文件挂载到容器中
- amazon-web-services - 使用 Elastic Beanstalk 的自定义指标
- jenkins - Jenkins 在无头 Firefox 浏览器上运行 selenium 脚本
- reactjs - 无法在 axios post 方法中替换 process.env.hostname
- javascript - 如何在编写变量 ejs、node.js 时禁用默认修剪?
- javascript - 我在哪里可以找到预先实现的 NodeJs 包的源代码?
- python - 将 tkinter GUI 与不同模块中的功能链接
- c++ - 如何将数组的所有值初始化为零