{"id":173,"date":"2014-04-22T08:34:15","date_gmt":"2014-04-22T00:34:15","guid":{"rendered":"http:\/\/www.datarelab.com\/blog\/?p=173"},"modified":"2014-04-22T08:34:15","modified_gmt":"2014-04-22T00:34:15","slug":"%5blinux%20ftp%e5%b7%a5%e5%85%b7%5d%20lftp%e5%91%bd%e4%bb%a4%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/www.datarelab.com\/blog\/Technical_literature\/173.html","title":{"rendered":"[Linux FTP\u5de5\u5177] lftp\u547d\u4ee4\u8be6\u89e3"},"content":{"rendered":"<p>\u4e00\u76f4\u60f3\u627e\u4e00\u4e2a\u5728linux\u91cc\u80fd\u4e0eFlashFXP\u6bd4\u80a9\u7684ftp\u5ba2\u6237\u7aef\uff0c\u8bd5\u8fc7\u4e86\u82e5\u5e72\u79cdGUI\u7684ftp client\uff0c\u6709free\u7684\u4e5f\u6709non-free\u7684\uff0c\u4f46\u5b9e\u9645\u7528\u8fc7\u5f97\u540c\u5fd7\u5e94\u8be5\u6e05\u695a\uff0c\u8bf4\u5b83\u4eec\u662flj\uff0c\u6050\u6015\u4f24\u4e86\u4f5c\u8005\u7684\u5fc3\uff0c\u4f46\u53c8\u5b9e\u5728\u627e\u4e0d\u51fa\u5176\u4ed6\u5f62\u5bb9\u3002\u8f6c\u4e86\u4e00\u5708\u53c8\u56de \u5230lftp\uff0c\u6ca1\u6709GUI\uff0c\u5bf9\u4e8e\u521d\u5b66\u8005\u6765\u8bf4\uff0c\u867d\u7136\u6709\u4e00\u70b9\u70b9\u75db\u82e6\uff0c\u4f46\u53ea\u8981\u60f3\u60f3\uff0clftp\u80fd\u5728\u4f17\u591aclient\u4e2d\u5c79\u7acb\u4e0d\u5012\u8fd9\u4e48\u591a\u5e74\uff0c\u800c\u4e14\u81f3\u4eca\u4ecd\u7136\u662flinux \u91cc\u6700\u9996\u63a8\u5d07\u7684\u5229\u5668\uff0c\u8db3\u4ee5\u8bf4\u660e\u4ed6\u7684\u529f\u80fd\u548c\u6613\u7528\u6027\u90fd\u662f\u4e0d\u9519\u7684\u3002\u6211\u7684\u7ecf\u9a8c\u662f\uff0c\u82b1\u4e00\u70b9\u65f6\u95f4\u6765\u5b66lftp\u662f\u503c\u5f97\u7684\uff0c\u4e0d\u8981\u518d\u5f92\u52b3\u5730\u5bfb\u627eGUI FTP Client\uff0c\u5728unix\u4e16\u754c\u91cc\uff0c\u6ca1\u6709FlashFXP!<\/p>\n<p>\u9996\u5148\u6765\u8bf4\u4e00\u4e0blftp\u767b\u5f55\u7ad9\u70b9\u7684\u64cd\u4f5c\uff0c\u6709\u597d\u51e0\u79cd\u65b9\u5f0f\uff0c\u90fd\u975e\u5e38\u7b80\u5355\u3002<\/p>\n<p>1. \u4e00\u6c14\u5475\u6210\u5f0f<br \/>\n$ lftp (ftp:\/\/)user:password@site:port<br \/>\n\u6bd4\u8f83\u5e38\u7528\u4e8e\u7f51\u9875\u6216bbs\u4e0a\u7ed9\u51fa\u7684\u73b0\u6210\u94fe\u63a5\uff0c\u7f3a\u70b9\u662fpassword\u663e\u793a\u4e3a\u660e\u6587\uff0c\u63a8\u8350\u5728\u6708\u9ed1\u98ce\u9ad8\u3001\u56db\u4e0b\u65e0\u4eba\u7684\u73af\u5883\u91cc\u5077\u5077\u8f93\u5165...\u5982\u679c\u4e0d\u5e78\u80cc\u540e\u6709\u4eba<br \/>\n$ lftp (ftp:\/\/)user@site:port<br \/>\n\u7136\u540e\u7cfb\u7edf\u4f1a\u63d0\u793a\u8f93\u5165password\uff0c\u8fd9\u662f\u5c31\u662f******\u4e86<\/p>\n<p>2. \u8001\u5b9e\u5df4\u4ea4\u578b<\/p>\n<p>$ lftp site -p port -u user,password<br \/>\n\u8fd9\u662flftp\u8bf4\u660e\u6587\u6863\u91cc\u7ed9\u51fa\u7684\u6807\u51c6\u65b9\u5f0f\uff0c\u8fd9\u4e00\u62db\u6bd4\u8f83\u8d39\u4f53\u529b\uff0c\u8bf7\u6839\u636e\u81ea\u5df1\u8eab\u4f53\u60c5\u51b5\u91cf\u529b\u800c\u884c\u3002\u5982\u679c\u4f53\u80fd\u4e00\u822c\uff0c\u53ef\u4ee5<br \/>\n$ lftp site:port -u user,password<br \/>\n\u4f3c\u4e4e\u662f\u7565\u5fae\u7701\u4e8b\u4e00\u70b9\u513f\uff0c\u6211\u4e00\u822c\u4e5f\u7528\u8fd9\u79cd\u65b9\u6cd5<\/p>\n<p>3. \u4e94\u77ed\u4e4b\u4e2d\u6697\u85cf\u4e00\u957f<\/p>\n<p>\u8fd9\u662f\u4e00\u4e2a\u9012\u5f52\u5d4c\u5957\u7684\u62db\u5f0f%\uffe5#@\uff01\u00d7&amp;<br \/>\n$ lftp<br \/>\nlftp:~&gt;lftp user:password@site:port<br \/>\n\u5c31\u662f\u8bf4\u5728lftp\u63a7\u5236\u53f0\u91cc\u8fdb\u884c\u64cd\u4f5c\uff0c\u548c\u5728\u7cfb\u7edf\u7ec8\u7aef\u662f\u5b8c\u5168\u4e00\u6837\u7684\uff0c\u4f60\u4ecd\u7136\u53ef\u4ee5\u6beb\u65e0\u987e\u5fcc\u5730\u7528\u4f7f\u7528\u524d\u9762\u4e24\u62db\uff0c\u540c\u65f6\u4e5f\u53ef\u4ee5\u7528o\u6216open\u4ee3\u66fflftp\uff0c\u540e\u9762\u7ad9\u70b9\u7528\u6237\u540d\u5bc6\u7801\u7684\u683c\u5f0f\u4e5f\u53ef\u4ee5\u6839\u636e\u81ea\u5df1\u504f\u597d\u8f93\u5165<\/p>\n<p>4. \u7ec8\u6781\u5927\u62db<\/p>\n<p>\u6bcf\u6b21\u767b\u5f55\u90fd\u72c2\u6572\u4e00\u884cuser:password@site:port\uff0c\u957f\u5e74\u7d2f\u6708\uff0c\u5c31\u7b97\u674e\u94c1\u6765\u4e86\u4e5f\u625b\u4e0d\u4f4f\u3002\u6240\u4ee5\u8fd8\u662f\u8981\u8ba9lftp\u628a\u5e38\u7528\u7684\u7ad9\u70b9\u8bb0\u4e0b\u6765\uff0c\u5c31\u8c61FlashFXP\u91cc\u7684\u7ad9\u53f0\u7ba1\u7406\u5668\uff0c\u5728lftp\u91cc\uff0c\u53eb\u505abookmark\uff0c\u5177\u4f53\u7684\u54b1\u4eec\u65e5\u540e\u518d\u8bf4<\/p>\n<p>\u767b\u5f55\u5b8c\u6210\u7b2c\u4e00\u4ef6\u4e8b\u5c31\u662f\u60f3\u770b\u770b\u8fd9\u4e2a\u670d\u52a1\u5668\u4e0a\u6709\u4ec0\u4e48\u597d\u4e1c\u4e1c\u3002<br \/>\n\u64cd \u4f5c\u548c\u7ec8\u7aef\u91cc\u662f\u4e00\u6837\u7684\uff0cls\u5c31\u662f\u5217\u51fa\u670d\u52a1\u5668\u76ee\u5f55\u3002\u6709\u4e00\u70b9\u8981\u8bf4\u660e\uff0c\u7b2c\u4e00\u6b21ls\u4e4b\u540e\uff0c\u76ee\u5f55\u8868\u5c31\u88ab\u4fdd\u5b58\u5230\u4e86\u672c\u5730cache\uff0c\u8fd9\u6837\u518d\u6b21ls\u5c31\u4e0d\u80fd\u5f97\u5230\u8fd9\u4e2a\u76ee\u5f55\u4e0b\u6700\u65b0 \u7684\u5217\u8868\uff0c\u8fd9\u65f6\u53ef\u4ee5\u7528rels\u91cd\u65b0\u4e0b\u8f7d\u76ee\u5f55\u8868\u3002\u8fd9\u91cc\u7684cache\u662flftp\u7684\u9ed8\u8ba4\u8bbe\u7f6e\uff0c\u76ee\u7684\u65e0\u975e\u5c31\u662f\u66f4\u5feb\u7684\u5f97\u5230\u5217\u8868\uff0c\u6709\u65f6\u5374\u4e0d\u7b26\u548c\u4f60\u7684\u4f7f\u7528\u4e60\u60ef\u3002\u53ef\u4ee5\u7528 cache on\u548ccache off\u5f00\u5173cache\uff0c\u4e5f\u53ef\u4ee5\u7528cache flush\u6765\u6e05\u7a7acache\u3002<br \/>\n\u66f4\u6539\u76ee\u5f55\u4e5f\u662fcd\uff0c\u6ca1\u4ec0\u4e48\u53ef\u8bf4\u7684\uff0clftp\u4e5f\u652f\u6301tab\u5339\u914d\u529f\u80fd\uff0c\u5927\u5927\u51cf\u5c11\u4e86\u52b3\u52a8\u5f3a\u5ea6\u3002<\/p>\n<p>lftp \u652f\u63f4\u4e86\u516d\u79cd\u6a21\u5f0f, ftp, ftps, http, https, hftp, fish and file(\u5f53\u7136\u4e86 https \u548c ftps \u7684\u652f\u63f4\u5fc5\u987b\u5728\u7f16\u8bd1\u5c31\u548c openssl library \u4e00\u8d77\u7f16\u8bd1\u597d)\u3002<\/p>\n<p>lftp \u5185\u5efa\u4e86 shell-like \u7684\u547d\u4ee4\u683c\u5f0f, \u5141\u8bb8\u5728\u80cc\u666f\u540c\u65f6\u6267\u884c\u591a\u4e2a\u547d\u4ee4(&amp;)\u3002\u6240\u6709\u80cc\u666f\u6267\u884c\u7684\u5de5\u4f5c\u90fd\u662f\u5728\u540c\u4e00\u4e2a\u7a0b\u5e8f\u4e2d(process), \u80fd\u5c06\u524d\u666f\u6267\u884c\u7684\u547d\u4ee4\u653e\u5230\u80cc\u666f\u6267\u884c(Ctrl-z), \u6216\u4ece\u80cc\u666f\u62ff\u56de\u524d\u666f\u6267\u884c(wait \u6216 fg), \u751a\u81f3\u8fd8\u53ef\u4ee5\u7ecf\u7531\u4e0a\u4e2a\u547d\u4ee4\u7684\u4f20\u56de\u503c\u6765\u51b3\u5b9a\u76ee\u524d\u8fd9\u4e2a\u547d\u4ee4\u662f\u5426\u8981\u6267\u884c(&amp;&amp; ||)\u3002<\/p>\n<p>\u5728\u7ed3\u675f lftp \u65f6, \u5982\u679c\u8fd8\u6709\u7a0b\u5e8f\u6267\u884c\u4e2d, lftp \u4f1a\u5c06\u81ea\u5df1\u5207\u6362\u5230 no hup \u6a21\u5f0f\u5e76\u653e\u5230\u80cc\u666f\u6267\u884c\u3002\u56e0\u6b64\u4e0d\u5fc5\u62c5\u5fc3\u6267\u884c lftp \u5f53\u4e2d\u65e0\u6cd5\u767b\u51fa\u3002<\/p>\n<p>!<br \/>\n\u53ef\u6267\u884c\u672c\u5730\u7aef shell \u4e2d\u7684\u547d\u4ee4, \u5982 !ls \/usr\/local\/bin\/<br \/>\n\u7531\u65bc lftp \u5e76\u6ca1\u6709 lls(\u663e\u793a\u672c\u5730\u7aef\u6863\u6848\u5217\u8868\u7684\u6307\u4ee4), \u6545\u53ef\u7528 !ls \u6765\u66ff\u4ee3\u3002<\/p>\n<p>alias []<br \/>\n\u5b9a\u4e49\u522b\u540d<br \/>\nalias less more<br \/>\nalias reconnect \"close; cd .\"<br \/>\n\u76f4\u63a5\u8f93\u5165 alias \u5373\u53ef\u770b\u5230\u76ee\u524d\u5b9a\u4e49\u4e86\u90a3\u4e9b\u522b\u540d\u3002\u5982\u679c\u53ea\u8f93\u5165 alias name \u7684\u8bdd, \u5219\u662f\u53d6\u6d88 name \u8fd9\u4e2a\u522b\u540d\u3002<\/p>\n<p>bookmark SUBCMD<br \/>\n\u8bbe\u5b9a\u4e66\u7b7e, \u53ef\u5c06\u76ee\u524d\u7ad9\u53f0\u53ca\u6240\u5728\u76ee\u5f55\u8bbe\u6210\u4e66\u7b7e, \u4e0b\u6b21\u53ef\u76f4\u63a5\u8fdb\u6765, \u4e0d\u7528\u518d cd \u6765 cd \u53bb\u7684<\/p>\n<p>bookmark add name \u7528\u6765\u65b0\u589e\u540d\u79f0\u4e3a name \u7684\u4e66\u7b7e<br \/>\nbookmark del name \u5220\u9664\u540d\u79f0\u4e3a name \u7684\u4e66\u7b7e<br \/>\nbookmark list \u663e\u793a\u76ee\u524d\u6709\u8bbe\u5b9a\u90a3\u4e9b\u4e66\u7b7e(\u53e6\u5916\u76f4\u63a5\u6253 bookmark \u548c bookmark list \u7684\u7ed3\u679c\u4e00\u6837)<br \/>\nbookmark edit \u547c\u53eb\u7f16\u8f91\u5668\u4fee\u6539\u4e66\u7b7e (~\/.lftp\/bookmarks)<\/p>\n<p>cd \u5207\u6362\u8fdc\u7aef\u76ee\u5f55<\/p>\n<p>cache SUBCMD<br \/>\n\u7ba1\u7406 lftp \u7684 cache<\/p>\n<p>rels []<br \/>\n\u4ece cache \u4e2d\u663e\u793a\u8fdc\u7aef\u6863\u6848\u5217\u8868<br \/>\nrels \u5219\u4e0d\u4f1a\u4ece cache \u4e2d\u8bfb\u53d6<\/p>\n<p>recls opts [path\/]pattern<br \/>\n\u4ece cache \u4e2d\u663e\u793a\u8fdc\u7aef\u7684\u6863\u6848\u5217\u8868, \u5e94\u8be5\u7b97\u662f ls \u7684\u52a0\u5f3a\u7248, \u6709\u5f88\u591a\u53c2\u6570\u53ef\u7528,\u5e94\u8be5\u662f\u53ef\u7528\u6765\u4ea7\u751f\u5404\u79cd\u4e0d\u540c&gt;\u7684\u6863\u6848\u5217\u8868\u4ee5\u4f9b\u5176\u4ed6\u7a0b\u5f0f\u4f7f\u7528\u3002<br \/>\nrecls \u5219\u4e0d\u4f1a\u4ece cache \u4e2d\u8bfb\u53d6<\/p>\n<p>du options<br \/>\n\u8ba1\u7b97\u8fdc\u7aef\u6574\u4e2a\u76ee\u5f55\u5360\u7528\u5bb9\u91cf<\/p>\n<p>get OPTS -o<br \/>\n\u6293\u53d6\u8fdc\u7aef\u6863\u6848<\/p>\n<p>get rfile -o lfile<br \/>\n\u6293 rfile \u5230\u672c\u5730\u6539\u540d\u4e3a lfile<br \/>\n-c \u4e3a\u7eed\u4f20<br \/>\n-E \u6293\u6863\u5b8c\u6210\u540e, \u5c06\u8fdc\u7aef\u7684\u6863\u6848\u780d\u4e86<br \/>\n-a \u4e3a ascii mode, \u9884\u8bbe\u4e3a binary mode<br \/>\n-O \u8bbe\u5b9a base directory \u4e3a\u672c\u5730\u7aef\u653e\u6863\u6848\u7684\u76ee\u5f55<\/p>\n<p>mget OPTS<br \/>\n\u4e0b\u8f7d\u8fdc\u7aef\u6863\u6848(\u53ef\u7528 wildcard expansion \u4e5f\u5c31\u662f *)<\/p>\n<p>pget OPTS -o<br \/>\n\u4f7f\u7528\u591a\u4e2a\u8fde\u7ed3\u6765\u4e0b\u8f7d\u6863\u6848, \u9884\u8bbe\u4e3a\u4e94\u4e2a\u3002<br \/>\n-n 3 \u4e3a\u53c1\u4e2a\u8fde\u7ed3<\/p>\n<p>jobs -v<br \/>\n\u663e\u793a\u76ee\u524d\u6709\u90a3\u4e9b\u7a0b\u5e8f\u5728\u80cc\u666f\u6267\u884c<br \/>\n-v \u663e\u793a\u8be6\u7ec6\u7684\u8d44\u8baf(-v \u53ef\u591a\u52a0\u51e0\u4e2a\u6765\u663e\u793a\u66f4\u8be6\u7ec6\u7684\u8d44\u8baf)<\/p>\n<p>lcd<br \/>\n\u5207\u6362\u672c\u5730\u7aef\u7684\u76ee\u5f55<\/p>\n<p>mirror OPTS remote [local]<br \/>\n\u4e0b\u8f7d\u6574\u4e2a\u76ee\u5f55(\u697c\u4e0a\u7684 get \u53ea\u80fd\u7528\u6765\u6293\u6863\u6848)<br \/>\n-c \u7eed\u4f20<br \/>\n-e \u8fd9\u4e2a\u8981\u5c0f\u5fc3\u4e00\u4e9b, \u6bd4\u8f83\u8fdc\u7aef\u548c\u672c\u5730\u7aef\u7684\u6863\u6848, \u5047\u5982\u8fdc\u7aef\u6ca1\u6709\u7684, \u5c31\u5c06\u672c\u5730\u7aef\u7684\u6863\u6848\u5220\u9664, \u4e5f\u5c31\u662f\u5c06\u672c\u5730\u7aef\u548c\u8fdc\u7aef\u8d44\u6599\u540c\u6b65\u3002<br \/>\n-R \u4e0a\u4f20\u6574\u4e2a\u76ee\u5f55<br \/>\n-n \u53ea\u4e0b\u8f7d\u8f83\u65b0\u7684\u6863\u6848<br \/>\n-r \u4e0d\u7528\u9012\u56de\u5230\u76ee\u5f55\u4e2d<br \/>\n--parallel=n \u540c\u65f6\u4e0b\u8f7d n \u4e2a\u6863\u6848(\u9884\u8bbe\u4e00\u6b21\u53ea\u4e0b\u8f7d\u4e00\u4e2a)<\/p>\n<p>module name args<br \/>\n\u8f7d\u5165\u6a21\u7ec4<\/p>\n<p>put OPTS -o<br \/>\n\u4e0a\u4f20\u6863\u6848<\/p>\n<p>mput OPTS<br \/>\n\u4e0a\u4f20\u6863\u6848(\u53ef\u7528 wildcard expansion \u4e5f\u5c31\u662f *)<\/p>\n<p>mv<br \/>\n\u5c06\u8fdc\u7aef\u7684 file1 \u6539\u540d\u4e3a file2<\/p>\n<p>mrm<br \/>\n\u7528 wildcard expansion \u65b9\u5f0f\u6765\u5220\u9664\u8fdc\u7aef\u6863\u6848<\/p>\n<p>open OPTS<br \/>\n\u5f00\u542f\u67d0\u4e2a\u7ad9\u53f0<br \/>\nopen -u , -p site<\/p>\n<p>queue OPTS []<br \/>\n\u5c06 cmd \u653e\u5230\u4f2b\u5217\u4e2d\u7b49\u5f85\u6267\u884c<br \/>\n-d index \u5c06\u7f16\u53f7\u4e3a index \u7684 job \u5220\u9664<br \/>\n-m index new_index \u5c06\u7f16\u53f7\u4e3a index \u7684 job \u79fb\u81f3\u7f16\u53f7 new_index, \u63d2\u961f\u4e13\u7528\u3002<br \/>\n-n index \u5728\u7f16\u53f7 index \u4e4b\u524d\u65b0\u589e\u4e00\u4e2a job<\/p>\n<p>wait []<br \/>\n\u5c06\u80cc\u666f\u6267\u884c\u4e2d\u7684\u7a0b\u5e8f\u79fb\u81f3\u524d\u666f(\u4e5f\u53ef\u7528 fg)<\/p>\n<p>kill all|<br \/>\n\u5220\u9664\u5168\u90e8\u7684 jobs \u6216 job_no<\/p>\n<p>repeat delay command<br \/>\n\u6bcf\u9694 delay \u79d2, \u91cd\u8986\u6267\u884c command, \u9884\u8bbe\u662f\u6bcf\u9694\u4e00\u79d2<\/p>\n<p>rm -r -f<br \/>\n\u79fb\u9664\u8fdc\u7aef\u6863\u6848<\/p>\n<p>mkdir -p<br \/>\n\u5efa\u7acb\u8fdc\u7aef\u76ee\u5f55<\/p>\n<p>rmdir -f<br \/>\n\u79fb\u9664\u8fdc\u7aef\u76ee\u5f55<\/p>\n<p>set OPT []<br \/>\n\u8bbe\u5b9a\u53d8\u6570<br \/>\n\u76f4\u63a5\u952e\u5165 set \u53ef\u770b\u76ee\u524d\u5b9a\u4e49\u4e86\u90a3\u4e9b\u53d8\u6570<\/p>\n<p>source<br \/>\n\u8bfb\u53d6 file, \u5e76\u6267\u884c file \u4e2d\u7684\u547d\u4ee4(\u5e94\u8be5\u662f\u548c bash \u4e2d\u7684 source \u547d\u4ee4\u662f\u4e00\u6837\u7684\u5427)<\/p>\n<p>debug [|off] -o<br \/>\n\u8bbe\u5b9a debug level \u4e3a level<br \/>\n-o \u5c06\u8f93\u51fa\u5bfc\u5411\u81f3 file<\/p>\n<p>exit [|bg]<br \/>\n\u7ed3\u675f lftp<br \/>\n\u6b64\u65f6\u82e5\u8fd8\u6709 jobs, \u5219\u4f1a\u5c06 lftp \u653e\u81f3\u80cc\u666f\u6267\u884c, \u7ee7\u7eed\u672a\u5b8c\u6210\u7684\u5de5\u4f5c<\/p>\n<p>history -w file-r file-c|-l cnt<br \/>\n\u548c bash \u4e2d\u7684 history \u529f\u80fd\u4e00\u6837<\/p>\n<p>renlist []<br \/>\n\u53ea\u663e\u793a\u8fdc\u7aef\u7684\u6863\u540d<\/p>\n<p>pwd -p<br \/>\n\u663e\u793a\u76ee\u524d\u8fdc\u7aef\u6240\u5728\u76ee\u5f55<br \/>\n-p \u8fde\u767b\u5165\u5bc6\u7801\u4e5f\u663e\u793a<\/p>\n<p>scache []<br \/>\n\u53ea\u6253 scache \u663e\u793a\u76ee\u524d\u6240\u6709\u7684 session, \u52a0\u4e0a session_no \u53ef\u5207\u6362\u81f3\u5176\u4ed6\u7684 session,<br \/>\n\u5bf9\u65bc\u540c\u65f6\u5f00\u542f\u591a\u4e2a\u7ad9\u53f0\u6216\u540c\u4e2a\u7ad9\u53f0\u4e0d\u540c\u76ee\u5f55\u95f4\u5207\u6362\u3002<\/p>\n<p>\u5c0f\u5f1f\u6709\u9047\u8fc7\u67d0\u4e9b\u7ad9\u53f0, \u4e00\u4e2a ip \u53ea\u5141\u8bb8\u767b\u5165\u4e00\u6b21\u7684,\u5982\u679c\u60f3\u540c\u65f6\u6293\u597d\u51e0\u4e2a\u6863\u6848\u5728\u4e0d\u540c\u76ee\u5f55\u4e0b,\u5c31<br \/>\n\u53ea\u80fd\u4e00\u6b21\u6293\u4e00\u4e2a,\u7b49\u5230\u6293\u5b8c\u4e86\u624d\u80fd\u518d\u5207\u6362\u5230\u522b\u7684\u76ee\u5f55\u53bb\u6293\u7b2c\u4e8c\u4e2a, \u8fd9\u65f6 lftp \u7684 queue \u5c31\u6d3e\u4e0a<br \/>\n\u7528\u573a\u4e86\u3002\u4e00\u822c\u4e0b\u4e86 get, mget \u7684\u8bdd, \u6863\u6848\u5c31\u76f4\u63a5\u5f00\u59cb\u4e0b\u8f7d\u4e86, \u8fd9\u65f6\u5c31\u65e0\u6cd5\u518d\u5207\u6362\u5230\u5176\u4ed6\u76ee\u5f55\u4e86, \u56e0\u6b64, \u5148\u5c06 queue \u7ed9\u505c\u6b62, \u9996\u5148\u4e0b\u4e2a queue, \u6309 enter, \u518d\u4e0b\u4e2a jobs \u5373\u53ef\u770b\u5230\u76ee\u524d qu<br \/>\neue \u662f\u505c\u6b62\u7684\u3002\u8fd9\u65f6\u518d\u5c06\u8981\u6293\u7684\u4e1c\u4e1c\u4e00\u4e2a\u4e2a\u52a0\u5165 queue \u4e2d, \u7b49\u5230\u8981\u6293\u7684\u4e1c\u4e1c\u90fd\u8fdb\u5165 queue \u540e<br \/>\n, \u518d\u4e0b queue start \u4e00\u6b21\u5168\u90e8\u4f20\u9001, \u8fd9\u6837\u5b50\u53ef\u7701\u53bb\u968f\u65f6\u6ce8\u610f\u6863\u6848\u662f\u5426\u6293\u5b8c,\u8ffc\u6210\u56f0\u6270\u3002<\/p>\n<p>lftp localhost:\/pub\/Iso&gt; queue<\/p>\n<p>lftp localhost:\/pub\/Iso&gt; jobs<br \/>\n0 queue (ftp:\/\/localhost)<br \/>\nQueue is stopped.<\/p>\n<p>lftp localhost:\/pub\/Iso&gt; queue get rettcd.iso<\/p>\n<p>lftp localhost:\/pub\/Iso&gt; jobs<br \/>\n0 queue (ftp:\/\/localhost)<br \/>\nQueue is stopped.<br \/>\nCommands queued:<br \/>\n1. get rettcd.iso<\/p>\n<p>lftp localhost:\/pub\/Iso&gt; queue mirror Linux\/<\/p>\n<p>lftp localhost:\/pub\/Iso&gt; jobs<br \/>\n0 queue (ftp:\/\/localhost)<br \/>\nQueue is stopped.<br \/>\nCommands queued:<br \/>\n1. get rettcd.iso<br \/>\n2. mirror Linux\/<\/p>\n<p>lftp localhost:\/pub\/Iso&gt; queue start<\/p>\n<p>lftp localhost:\/pub\/Iso&gt; jobs<br \/>\n0 queue (ftp:\/\/localhost)<br \/>\nNow executing: 1 get rettcd.iso<br \/>\nCommands queued:<br \/>\n1. mirror Linux\/<br \/>\n1 get rettcd.iso<br \/>\n`rettcd.iso' at 4772864 (9%) 3.00M\/s eta:14s Receiving data<br \/>\n\u76f8\u5173\u6587\u4ef6<\/p>\n<p>\/etc\/lftp.conf<br \/>\n\u5168\u5c40\u914d\u7f6e\u6587\u4ef6\uff0c\u5b9e\u9645\u4f4d\u7f6e\u4f9d\u8d56\u7cfb\u7edf\u914d\u7f6e\u6587\u4ef6\u76ee\u5f55\uff0c\u53ef\u80fd\u5728\/etc\uff0c\u4e5f\u53ef\u80fd\u5728\/usr\/local\/etc<\/p>\n<p>~\/.lftp\/rc, ~\/.lftprc<br \/>\n\u7528\u6237\u914d\u7f6e\u6587\u4ef6\uff0c\u5c06\u5728\/etc\/lftp.conf\u4e4b\u540e\u6267\u884c\uff0c\u6240\u4ee5\u8fd9\u91cc\u9762\u7684\u8bbe\u7f6e\u4f1a\u8986\u76d6\/etc\/lftp.conf\u4e2d\u7684\u8bbe\u7f6e\u3002<br \/>\nlftp \u7f3a\u7701\u4e0d\u4f1a\u663e\u793a ftp \u670d\u52a1\u5668\u7684\u6b22\u8fce\u4fe1\u606f\u548c\u9519\u8bef\u4fe1\u606f\uff0c\u8fd9\u5728\u5f88\u591a\u65f6\u5019\u4e0d\u65b9\u4fbf\uff0c\u56e0\u4e3a\u4f60\u6709\u53ef\u80fd\u60f3\u77e5\u9053\u8fd9\u4e2a\u670d\u52a1\u5668\u5230\u5e95\u662f\u56e0\u4e3a\u6ca1\u5f00\u673a\u8fde\u4e0d\u4e0a\uff0c\u8fd8\u662f\u8fde\u63a5\u6570\u5df2\u6ee1\u3002\u5982\u679c\u662f\u8fd9\u6837\uff0c\u4f60\u53ef\u4ee5\u5728 ~\/.lftprc \u91cc\u5199\u5165\u4e00\u884c<\/p>\n<p>debug 3<\/p>\n<p>\u5c31\u53ef\u4ee5\u770b\u5230\u51fa\u9519\u4fe1\u606f\u4e86\u3002<br \/>\n\u66f4\u591a\u7684\u914d\u7f6e\u9009\u9879\u8bf7\u67e5man\u624b\u518c\u6216\u5728lftp\u754c\u9762\u5185\u7528\u547d\u4ee4 set -a \u83b7\u5f97\u3002<\/p>\n<p>~\/.lftp\/log<br \/>\n\u5f53lftp\u8f6c\u4e3a\u540e\u53f0\u975e\u6302\u8d77\u6a21\u5f0f\u6267\u884c\u65f6\uff0c\u8f93\u51fa\u5c06\u91cd\u5b9a\u5411\u5230\u8fd9\u91cc<\/p>\n<p>~\/.lftp\/bookmarks<br \/>\n\u8fd9\u662flftp\u5b58\u50a8\u4e66\u7b7e\u7684\u5730\u65b9\uff0c\u53ef\u4ee5lftp\u67e5\u770bbookmark\u547d\u4ee4<\/p>\n<p>~\/.lftp\/cwd_history<br \/>\n\u8fd9\u4e2a\u6587\u4ef6\u7528\u6765\u5b58\u50a8\u8bbf\u95ee\u8fc7\u7684\u7ad9\u70b9\u7684\u5de5\u4f5c\u76ee\u5f55<\/p>\n<p>\u78b0\u5230\u4e00\u4e2a\u4e2d\u6587\u5b57\u7b26\u96c6\u663e\u793a\u7684\u95ee\u9898, Remote FTP Server \u7684 Charset \u662f gb2312 \u7684, \u6211\u82e5\u76f4\u63a5 ls, \u6240\u6709\u4e2d\u6587\u5b57\u7b26\u90fd\u662f\u4e71\u7801, \u6839\u672c\u6ca1\u6709\u529e\u6cd5\u4f7f\u7528. \u8981\u8fd9\u6837\u7ed9\u4e00\u4e2a\u53c2\u6570\u624d\u884c:<\/p>\n<p>lftp ryun@www.example.com:\/&gt;set ftp:charset gb2312<\/p>\n<p>\u7136\u540e\u518d ls \u4e00\u4e0b\u770b\u770b, \u662f\u4e0d\u662f\u4eb2\u5207\u591a\u4e86 ^____^<\/p>\n<p>\u8fd9\u91cc\u8fd8\u6709\u4e00\u4e2a\u65b9\u6cd5, \u9488\u5bf9\u7ecf\u5e38\u4f7f\u7528\u4e2d\u6587\u5b57\u7b26\u96c6FTP\u7684\u670b\u53cb\u53ef\u4ee5\u8fd9\u6837\u6765\u8bbe\u5b9a\u914d\u7f6e\u6587\u4ef6:<\/p>\n<p>touch ~\/.lftp\/rc<br \/>\necho 'debug 4' &gt;&gt; ~\/.lftp\/rc<br \/>\necho 'set ftp:charset GBK' &gt;&gt; ~\/.lftp\/rc<\/p>\n<p>\u73b0\u5728 lftp \u540e\u76f4\u63a5\u652f\u6301\u4e2d\u6587\u5b57\u7b26\u663e\u793a<\/p>\n<p>\u65e0\u6cd5\u88ab\u52a8\u6a21\u5f0f\u8fde\u63a5\uff0c\u8f6c\u4e3a\u4e3b\u52a8\u6a21\u5f0f\u5c31\u53ef\u4ee5\u5217\u76ee\u5f55\u4e86\uff1a\u5728 lftp \u767b\u5f55\u540e\u6267\u884c\uff1a<br \/>\nset ftp:passive-mode no<\/p>\n<div style=\"white-space:nowrap;\">\n\t\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u76f4\u60f3\u627e\u4e00\u4e2a\u5728linux\u91cc\u80fd\u4e0eFlashFXP\u6bd4\u80a9\u7684ftp\u5ba2\u6237\u7aef\uff0c\u8bd5\u8fc7\u4e86\u82e5\u5e72\u79cdGUI\u7684ftp client\uff0c\u6709 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[154],"class_list":["post-173","post","type-post","status-publish","format-standard","hentry","category-Technical_literature","tag-lftp"],"views":1542,"_links":{"self":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/173","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/comments?post=173"}],"version-history":[{"count":0,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/173\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/media?parent=173"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/categories?post=173"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/tags?post=173"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}