{"id":138452,"date":"2019-03-11T08:33:21","date_gmt":"2019-03-11T00:33:21","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=138452"},"modified":"2019-02-27T09:35:15","modified_gmt":"2019-02-27T01:35:15","slug":"transfer-file","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/transfer-file.html","title":{"rendered":"transfer.sh:\u901a\u8fc7\u547d\u4ee4\u884c\u7b80\u5355\u7684\u521b\u5efa\u6587\u4ef6\u5206\u4eab"},"content":{"rendered":"
\u901a\u8fc7\u4e00\u4e2a\u547d\u4ee4\uff0c\u5c31\u53ef\u4ee5\u5728\u7ec8\u7aef\u4e0a\uff0c\u5c06\u6587\u4ef6\u52a0\u5bc6\u4f20\u8f93\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\uff0c\u63d0\u4f9b\u5bf9\u5916\u6587\u4ef6\u5171\u4eab\u7684\u529f\u80fd\u3002<\/p>\n
transfer.sh\u8fd9\u662f\u4e00\u4e2a\u6211\u5e38\u7528\u7684\u3001\u53ef\u4ee5\u5728\u7ec8\u7aef\u4e0a\u4f7f\u7528\u7684\u6587\u4ef6\u5171\u4eab\u670d\u52a1\uff0c\u53ef\u4ee5\u5728\u67d0\u4e9b\u65b9\u9762\u66ff\u4ee3sz\u6216\u8005scp\u547d\u4ee4\u3002\u901a\u8fc7\u914d\u7f6e\uff0c\u7ec8\u7aef\u4e0a\u4e00\u4e2a\u547d\u4ee4\u5c31\u53ef\u4ee5\u5c06\u6587\u4ef6\u52a0\u5bc6\u4f20\u8f93\u5230\u8fdc\u7a0b\u670d\u52a1\u5668\uff0c\u65b9\u4fbf\u4e0b\u8f7d\u3002\u5e38\u89c4\u4f7f\u7528\u9700\u8981\u6709 linux \u547d\u4ee4\u884c\u7684\u57fa\u7840\uff0c\u56fd\u5185\u867d\u7136\u8bbf\u95ee\u7565\u6162\u3002\u5728\u56fd\u5916\u7684VPS\u4e0a\u5355\u7ebf\u7a0b\u4e0b\u8f7d\u51e0\u4e4e\u662f\u80fd\u8dd1\u6ee1\u5e26\u5bbd\u7684\uff0c\u53ef\u4ee5\u8bf4\u6ca1\u9650\u901f\u3002\u914d\u5408\u4e00\u4e9b\u6ca1\u6709 gui \u754c\u9762\u7684\u7ec8\u7aef\u547d\u4ee4\u884c\u7b80\u76f4\u4e0d\u80fd\u518d\u723d\u3002<\/p>\n
<\/p>\n
\u53ea\u9700\u8981\u628a\u4e0b\u8ff0\u4ee3\u7801\u52a0\u5165\u5230\u4ea4\u4e92shell\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u5373\u53ef\uff0c\u6211\u7528\u7684\u662fzsh\uff0c\u6240\u4ee5\u7f16\u8bd1 ~\/.zshrc\uff0c\u5c06\u8fd9\u6bb5\u811a\u672c\u52a0\u5165\u8fdb\u53bb\uff0c\u5199\u5165\u4fdd\u5b58\u4e4b\u540e\u6267\u884c\"source ~\/.zshrc\"\u5237\u65b0\u4e00\u4e0b\u3002<\/p>\n
transfer() { if [ $# -eq 0 ]; then echo -e \"No arguments specified. Usage:\\necho transfer \/tmp\/test.md\\ncat \/tmp\/test.md | transfer test.md\"; return 1; fi\r\ntmpfile=$( mktemp -t transferXXX ); if tty -s; then basefile=$(basename \"$1\" | sed -e 's\/[^a-zA-Z0-9._-]\/-\/g'); curl --progress-bar --upload-file \"$1\" \"https:\/\/transfer.sh\/$basefile\" >> $tmpfile; else curl --progress-bar --upload-file \"-\" \"https:\/\/transfer.sh\/$1\" >> $tmpfile ; fi; cat $tmpfile; rm -f $tmpfile; }<\/pre>\n\u4f7f\u7528<\/strong><\/div>\n\u4f7f\u7528\u4e5f\u975e\u5e38\u7b80\u5355\uff0c\u5bf9\u9700\u8981\u4e0a\u4f20\u5206\u4eab\u7684\u6587\u4ef6\u6267\u884c\"transfer\"\u547d\u4ee4\u5c31\u53ef\u4ee5\u4e86\uff0c\u6bd4\u5982\u5f53\u524d\u76ee\u5f55\u4e0b\u6709\u4e00\u4e2aBDW.sh\u7684\u811a\u672c\uff0c\u6267\u884c\"transfer BDW.sh \"<\/p>\n
<\/p>\n
\u6587\u4ef6\u4e0a\u4f20\u6210\u529f\u4e4b\u540e\u4f1a\u8fd4\u56de\u4e00\u4e2a\u94fe\u63a5\u5730\u5740\uff0c\u5c31\u662f\u5f53\u524d\u4e0a\u4f20\u7684\u6587\u4ef6\u7f51\u7edc\u5730\u5740\uff0c\u6587\u4ef6\u9ed8\u8ba4\u4fdd\u5b58 14 \u5929\uff0c\u4e4b\u540e\u81ea\u52a8\u5220\u9664\u3002<\/p>\n