简体   繁体   English

如何通过网络写入文件

[英]How to write to a file over the network

I have two ubuntu linux boxes: I'm in bash on one machine running some battery of tests (storage, memory, etc.). 我有两个ubuntu linux盒子:我在一台机器上运行bash,正在运行一些电池测试(存储,内存等)。 Now, I want to test writing to a file over the network to the other linux box. 现在,我想测试通过网络将文件写入另一个Linux盒的过程。 Any idea of the command to write to a file across the network (behind the same router)? 对通过网络(在同一路由器后面)写入文件的命令有任何想法吗? I could easily ssh into the second machine, but I want to send data across the network, writing to a file at the root or some particular directory. 我可以轻松地切换到第二台计算机,但是我想通过网络发送数据,写入根目录或某个特定目录中的文件。 Thanks! 谢谢!

You should use scp (Secure copy) or rsync (Remote Sync). 您应该使用scp(安全副本)或rsync(远程同步)。

From the command line type 从命令行输入

scp file_to_copy user@remote_linx:/tmp/copy_of_file

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM