Created
February 1, 2017 02:20
-
-
Save pocari/7d620f7bca850b3e52796dff67d11676 to your computer and use it in GitHub Desktop.
ncで簡易ファイル転送
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 送信、受信側が同一のサンプルになっているが別ホストでも可 | |
################################################################ | |
# 単純にファイル転送 | |
# 送信側ホスト | |
# ポート12345でdata.txtの内容を転送するための口を開けて待受 | |
nc -l 12345 < data.txt | |
# 受信側ホスト | |
nc 127.0.0.1 12345 > data.txt | |
################################################################ | |
# tar.gzで固めた内容を転送 | |
# 送信側ホスト | |
tar zcvf - | nc -l 12345 | |
# 受信側ホスト | |
nc 127.0.0.1 12345 | tar zxvf - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment