Linux下nc传输文档

# 发送端 host: fasong IP:192.168.0.100
# 接受端 host:jieshou IP:192.168.0.200
#
先在其中一端建立端口监听

# 1. 单个文件 (file) # 发送端监听 nc -l 1234 < file # 接收端 nc fasong 1234 > file # nc 192.168.0.100 1234 > file # 接收端监听 nc -l 1234 > file # 发送端 nc jieshou 1234 < file # nc 192.168.0.200 1234 < file

# 2. 多个文件 (file1,file2,file3,file4) # 发送端监听 tar -cvzf - file* | nc -l 1234 # 接收端 nc fasong 1234 | tar xvzf - # nc 192.168.0.100 1234 | tar xvzf - # 指定目录 # nc 192.168.0.100 1234 | tar xvzf - -C /tmp # 1.注意命令中的 - # 2.只能在发送端建立监听 # 3.发送端建立监听后,直接在接收端执行接收命令。

 

posted on 2014-12-05 16:42  Erbin  阅读(223)  评论(0编辑  收藏  举报

导航