Linux 之 tar和nc传文件
前提:
将 172.16.88.1 上的 test 文件夹传送到 172.16.88.2 上
接收方 ---- 172.16.88.2
$ nc -l 9876 > test.tar
9876 为端口号
发送方 ---- 172.16.88.1
$ tar -zcvf - test | nc 172.16.88.2 9876
test 为待传文件夹
9876 为接收方监听的端口号
将 172.16.88.1 上的 test 文件夹传送到 172.16.88.2 上
$ nc -l 9876 > test.tar
9876 为端口号
$ tar -zcvf - test | nc 172.16.88.2 9876
test 为待传文件夹
9876 为接收方监听的端口号