Related:
- linux nc命令传输文件(远程复制文件) http://www.jb51.net/LINUXjishu/489230.html
- linux 下的nc使用 http://blog.sina.com.cn/s/blog_5a140b930101fwke.html
- Linux nc命令详解 http://www.68idc.cn/help/server/linux/2014040682705.html
背景:
将94的1.txt复制到139上
- 接收端(nc -l 4357 > 1.txt)
[work@tjtx-126-139 binlog]$ ls
[work@tjtx-126-139 binlog]$ pwd/data/binlog
[work@tjtx-126-139 binlog]$ nc -l 4357 > 1.txt
[work@tjtx-126-139 binlog]$ ls1.txt7
[work@tjtx-126-139 binlog]$ cat 1.txt
[work@tjtx-126-139 binlog]$
发送端(nc 10.126.126.139 4357 < 1.txt)
[work@tjtx-126-94 nctest]$ cat 1.txt210.126.126.943
[work@tjtx-126-94 nctest]$ ls
1.txt5
[work@tjtx-126-94 nctest]$ nc 10.126.126.139 4357 < 1.txt
[work@tjtx-126-94 nctest]$ cat 1.txt710.126.126.94
注意事项:
- 注意别写错顺序了,要不源文件会置空
- 接收端 先启动
实战:将9个G的文件binlog文件快速移动到其他机器
- 发送端:
[work@tjtx-126-94 binlog]$ pwd /data/binlog
[work@tjtx-126-94 binlog]$ ll -t
total 9437256
-rw-rw---- 1 work work 1073741958 Nov 29 11:46 tc-mysql-bin.000313
-rw-rw---- 1 work work 1073742498 Nov 29 11:45 tc-mysql-bin.000314
-rw-rw---- 1 work work 1073742467 Nov 29 11:39 tc-mysql-bin.000315
[work@tjtx-126-94 binlog]$ nc 10.126.126.139 4357 < tc-mysql-bin.000313
[work@tjtx-126-94 binlog]$ nc 10.126.126.139 4357 < tc-mysql-bin.000314
[work@tjtx-126-94 binlog]$ nc 10.126.126.139 4357 < tc-mysql-bin.000315
- 接收端
[work@tjtx-126-139 binlog]$ pwd
/data/binlog
[work@tjtx-126-139 binlog]$ ll -t
total 0
[work@tjtx-126-139 binlog]$ nc -l 4357 > tc-mysql-bin.000313
[work@tjtx-126-139 binlog]$ nc -l 4357 > tc-mysql-bin.000314
[work@tjtx-126-139 binlog]$ nc -l 4357 > tc-mysql-bin.000315
网友评论