{"id":702,"date":"2019-06-24T14:14:24","date_gmt":"2019-06-24T06:14:24","guid":{"rendered":"http:\/\/cn.hostease.com\/blog\/?p=702"},"modified":"2024-11-21T15:19:34","modified_gmt":"2024-11-21T07:19:34","slug":"%e5%b8%b8%e8%a7%81%e7%9a%84linux%e4%b8%8e%e5%91%bd%e4%bb%a4%e8%a1%8c%e9%87%8d%e5%ae%9a%e5%90%91","status":"publish","type":"post","link":"https:\/\/cn.hostease.com\/blog\/shared-hosting\/%e5%b8%b8%e8%a7%81%e7%9a%84linux%e4%b8%8e%e5%91%bd%e4%bb%a4%e8%a1%8c%e9%87%8d%e5%ae%9a%e5%90%91\/","title":{"rendered":"\u5e38\u89c1\u7684Linux\u4e0e\u547d\u4ee4\u884c\u91cd\u5b9a\u5411"},"content":{"rendered":"<p>Linux\u7684\u4e00\u4e2a\u6838\u5fc3\u539f\u5219\u662f\uff0c\u8f6f\u4ef6\u5e94\u7528\u7a0b\u5e8f\u5e94\u8be5\u5f88\u5c0f\uff0c\u53ea\u5305\u542b\u5176\u5b8c\u6210\u5de5\u4f5c\u6240\u9700\u7684\u5185\u5bb9\u3002\u4e0e\u5176\u5728\u73b0\u6709\u8f6f\u4ef6\u4e2d\u6784\u5efa\u65b0\u529f\u80fd\uff0c\u4e0d\u5982\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u8fd9\u4e9b\u5c0f\u5e94\u7528\u7a0b\u5e8f\u7684\u8bbe\u8ba1\u76ee\u7684\u901a\u5e38\u4e3a\u534f\u540c\u5de5\u4f5c\uff0c\u5176\u4e2d\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u7684\u8f93\u51fa\u7528\u4f5c\u53e6\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u7684\u8f93\u5165\u3002\u5bf9\u4e8e\u73b0\u4ee3UNIX\u548c<a href=\"https:\/\/cn.hostease.com\/shared-hosting.html\">Linux\u7cfb\u7edf<\/a>\u4e0a\u7684\u5927\u591a\u6570\u547d\u4ee4\u884c\u5e94\u7528\u7a0b\u5e8f\uff0c\u8fd9\u4ecd\u7136\u9002\u7528\u3002<\/p>\n<p>\u8f93\u5165\/\u8f93\u51fa\u8bbe\u5907<\/p>\n<p>\u547d\u4ee4\u884c\u5e94\u7528\u7a0b\u5e8f\u901a\u5e38\u6709\u4e09\u4e2a\u8f93\u5165\/\u8f93\u51fa\u8bbe\u5907\uff1a<\/p>\n<p>\u6807\u51c6\u7684\u8f93\u5165\uff08\u4e5f\u79f0\u4e3aSTDIN\uff09\u2014\u2014\u901a\u5e38\u662f\u952e\u76d8\u3002<\/p>\n<p>\u6807\u51c6\u8f93\u51fa\uff08STDOUT\uff09\u2014\u2014\u901a\u5e38\u662f\u5728\u5c4f\u5e55\u4e0a\u3002<\/p>\n<p>\u6807\u51c6\u9519\u8bef\uff08STDERR\uff09\u2014\u2014\u540c\u6837\uff0c\u901a\u5e38\u662f\u5c4f\u5e55\u3002<\/p>\n<p>\u5728\u4f7f\u7528Linux\u6216Unix\u547d\u4ee4\u884c\u65f6\uff0c\u91cd\u5b9a\u5411\u662f\u66f4\u6539\u8fd9\u4e09\u4e2a\u8f93\u5165\u548c\u8f93\u51fa\u7684\u4f4d\u7f6e\u7684\u884c\u4e3a\u3002\u5f53\u7136\uff0c\u5982\u679c\u6709\u7ad9\u957f\u5bf9Windows\u4e5f\u6bd4\u8f83\u611f\u5174\u8da3\uff0c\u53ef\u4ee5\u9605\u8bfb <a href=\"https:\/\/cn.hostease.com\/blog\/shared-hosting\/637.html\">Windows\u4e0eLinux\u865a\u62df\u4e3b\u673a\u5e94\u8be5\u600e\u6837\u9009\u62e9<\/a>\u3002<\/p>\n<p>\u7ba1\u9053<\/p>\n<p>\u9996\u5148\uff0c\u4e5f\u53ef\u80fd\u662f\u6700\u5e38\u89c1\u7684\uff0c\u662f\u7ba1\u9053\uff0c\u901a\u8fc7\u5728\u547d\u4ee4\u4e2d\u4f7f\u7528\u7ba1\u9053\u201c|\u201d\u5b57\u7b26\u6765\u7a81\u51fa\u663e\u793a\u3002\u7ba1\u9053\u5b57\u7b26\u7528\u4e8e\u83b7\u53d6\u5e94\u7528\u7a0b\u5e8f\u7684\u6807\u51c6\u8f93\u51fa\uff0c\u5e76\u5c06\u5176\u63d2\u5165\u53e6\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u7684\u6807\u51c6\u8f93\u5165\u4e2d\u3002\u4f7f\u7528\u7ba1\u9053\u53ef\u4ee5\u5c06\u8bb8\u591a\u5e94\u7528\u7a0b\u5e8f\u653e\u5728\u4e00\u8d77\uff0c\u4ece\u800c\u6709\u6548\u5730\u521b\u5efa\u66f4\u590d\u6742\u7684\u5de5\u5177\u6765\u5b8c\u6210\u5de5\u4f5c\u3002<\/p>\n<p>\u8f93\u51fa\u91cd\u5b9a\u5411<\/p>\n<p>\u63a5\u4e0b\u6765\u662f\u7279\u5b9a\u7684\u8f93\u51fa\u91cd\u5b9a\u5411\u3002\u8fd9\u662f\u901a\u8fc7\u4f7f\u7528\u201c&gt;\u201d\u5b57\u7b26\u6765\u5b9e\u73b0\u7684\u3002\u5b83\u653e\u5728\u5e94\u7528\u7a0b\u5e8f\u7684\u547d\u4ee4\u548c\u53c2\u6570\u4e4b\u540e\u3002\u8fd9\u610f\u5473\u7740\u6807\u51c6\u8f93\u51fa\u5c06\u88ab\u91cd\u5b9a\u5411\u5230\u7b26\u53f7\u540e\u7ed9\u51fa\u7684\u6587\u4ef6\u540d\uff0c\u4f8b\u5982\uff1a<\/p>\n<p>ls -l &gt; filelist.txt<\/p>\n<p>\u8fd9\u5c06\u628a\u201cls -l\u201d\u547d\u4ee4\u7684\u8f93\u51fa\u653e\u5165\u540d\u4e3afilelist.txt\u7684\u6587\u4ef6\u4e2d\u3002\u5982\u679c\u6587\u4ef6\u4e0d\u5b58\u5728\uff0c\u6587\u4ef6\u5c06\u88ab\u521b\u5efa\uff0c\u5982\u679c\u6587\u4ef6\u5b58\u5728\uff0c\u90a3\u4e48\u5176\u4e2d\u7684\u4efb\u4f55\u5185\u5bb9\u90fd\u5c06\u88ab\u5220\u9664\u548c\u66ff\u6362\u3002\u5f53\u6807\u51c6\u9519\u8bef\u6ca1\u6709\u88ab\u91cd\u5b9a\u5411\u65f6\uff0c\u4efb\u4f55\u51fa\u73b0\u7684\u9519\u8bef\u4ecd\u7136\u4f1a\u5448\u73b0\u5230\u5c4f\u5e55\u4e0a\u3002<\/p>\n<p>\u53ea\u6709\u5f53\u6587\u4ef6\u5b58\u5728\u5e76\u4e14\u5df2\u7ecf\u5305\u542b\u8981\u4fdd\u5b58\u7684\u6570\u636e\uff0c\u5e76\u4e14\u65b0\u6570\u636e\u5c06\u5199\u5165\u6587\u4ef6\u672b\u5c3e\u65f6\uff0c\u7b26\u53f7\u52a0\u500d\u624d\u80fd\u6267\u884c\u76f8\u540c\u7684\u4efb\u52a1\u3002\u4f8b\u5982\uff1a<\/p>\n<p>ls -l &gt;&gt; filelist.txt<\/p>\n<p>\u8fd8\u53ef\u4ee5\u5728\u524d\u7f00\u524d\u9762\u52a0\u4e0a\u4e00\u4e2a&amp;\u7b26\u53f7\uff0c\u4ee5\u5c06\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u91cd\u5b9a\u5411\u5230\u63d0\u4f9b\u7684\u6587\u4ef6\u3002<\/p>\n<p>ls -l &amp;&gt; filelist.txt<\/p>\n<p>\u73b0\u5728\uff0c\u6709\u4e00\u4e2a\u66f4\u7279\u6b8a\u7684\u60c5\u51b5\uff1a\u9664\u4e86\u540d\u79f0\u4e4b\u5916\uff0c\u6bcf\u4e2a\u8f93\u5165\u548c\u8f93\u51fa\u90fd\u6709\u4e00\u4e2a\u6570\u5b57\uff0c\u5176\u4e2dstdin\u503c\u4e3a0\uff0cstdout\u4e3a1\uff0cstderr\u4e3a2\u3002\u4f7f\u7528\u8fd9\u4e9b\u6570\u5b57\uff0c\u8fd8\u53ef\u4ee5\u5c06\u9519\u8bef\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\u6807\u51c6\u8f93\u51fa\uff0c\u53cd\u4e4b\u4ea6\u7136\u3002\u56e0\u6b64\uff0c\u6709\u65f6\u53ef\u80fd\u4f1a\u770b\u5230\u524d\u9762\u7684\u793a\u4f8b\uff0c\u5c06\u6807\u51c6\u8f93\u51fa\u548c\u6807\u51c6\u9519\u8bef\u540c\u65f6\u5199\u5165\u7f16\u5199\u6210\u8fd9\u6837\u7684\u6587\u4ef6\uff1a<\/p>\n<p>ls -l &gt; filelist.txt 2&gt;&amp;1<\/p>\n<p>\u8fd8\u53ef\u4ee5\u4f7f\u7528\u4e0d\u540c\u7684\u6587\u4ef6\u8fdb\u884c\u8f93\u51fa\u548c\u9519\u8bef\uff0c\u4f8b\u5982\uff1a<\/p>\n<p>ls -l &gt; filelist.txt 2&gt; errors.txt<\/p>\n<p>\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u6b63\u5e38\u7684\u8f93\u51fa\u5c06\u8f6c\u5230filelist.txt\uff0c\u751f\u6210\u7684\u4efb\u4f55\u9519\u8bef\u90fd\u53ef\u4ee5\u5728errors.txt\u4e2d\u770b\u5230\u3002<\/p>\n<p>\u8f93\u5165\u91cd\u5b9a\u5411<\/p>\n<p>\u9664\u4e86\u8f93\u51fa\u91cd\u5b9a\u5411\uff0c\u8fd8\u53ef\u4ee5\u8fdb\u884c\u8f93\u5165\u91cd\u5b9a\u5411\u3002\u4e0e\u8f93\u51fa\u91cd\u5b9a\u5411\u7c7b\u4f3c\uff0c\u8f93\u5165\u91cd\u5b9a\u5411\u7528\u4e8e\u5c06\u6587\u4ef6\u7684\u5185\u5bb9\u53d1\u9001\u5230\u5e94\u7528\u7a0b\u5e8f\u7684\u6807\u51c6\u8f93\u5165\u3002\u8bf7\u770b\u4ee5\u4e0b\u4f8b\u5b50\uff1a<\/p>\n<p>iptables-restore &lt; iptables.rules<\/p>\n<p>\u201ciptables &#8211; restore\u201d\u547d\u4ee4\u5c06\u4f7f\u7528\u6807\u51c6\u8f93\u5165\u5904\u7ed9\u51fa\u7684\u89c4\u5219\u8bbe\u7f6eiptables\u9632\u706b\u5899\u89c4\u5219\u3002\u8f93\u5165\u91cd\u5b9a\u5411\u5141\u8bb8\u4f7f\u7528iptables.rules\u6587\u4ef6\u7684\u5185\u5bb9\u7528\u4f5c\u6b64\u8f93\u5165\uff0c\u5b83\u901a\u5e38\u4e0eiptables-save\u547d\u4ee4\u7ed3\u5408\u4f7f\u7528\uff0c\u4ee5\u4fdd\u5b58\u548c\u6062\u590d\u9632\u706b\u5899\u89c4\u5219\u3002<\/p>\n<p>Tee\u547d\u4ee4<\/p>\n<p>\u6700\u540e\uff0c\u8fd8\u6709\u4e00\u4e2a\u7279\u6b8a\u547d\u4ee4\uff1atee\u547d\u4ee4\u3002\u6b64\u547d\u4ee4\u5c06\u5176\u8f93\u5165\u540c\u65f6\u5199\u5165\u6587\u4ef6\u548c\u6807\u51c6\u8f93\u51fa\u3002\u5f53\u7f16\u5199\u4e00\u4e2a\u957f\u547d\u4ee4\u65f6\uff0c\u5176\u4e2d\u6709\u8bb8\u591a\u547d\u4ee4\u901a\u8fc7\u7ba1\u9053\u8fde\u63a5\u5728\u4e00\u8d77\uff0c\u8fd9\u6837\u53ef\u4ee5\u65b9\u4fbf\u5730\u770b\u5230\u8f93\u51fa\u662f\u901a\u8fc7\u94fe\u7684\u4e00\u90e8\u5206\u3002\u56e0\u4e3a\u8fd9\u662f\u4e00\u4e2a\u666e\u901a\u7684\u547d\u4ee4\uff0c\u6240\u4ee5\u5728\u4f7f\u7528tee\u4e4b\u524d\u5fc5\u987b\u4f7f\u7528\u7ba1\u9053\uff1a<\/p>\n<p>ls -l | tee filelist.txt<\/p>\n<p>\u968f\u540e\uff0c\u5c06\u770b\u5230\u8fd9\u4e2a\u547d\u4ee4\uff0c\u53ef\u4ee5\u5728\u5c4f\u5e55\u4e0a\u67e5\u770b\u8f93\u51fa\uff0c\u4e5f\u53ef\u4ee5\u5c06\u8f93\u51fa\u5199\u5165\u6587\u4ef6\u3002\u8fd9\u6837\uff0cLinux\u547d\u4ee4\u884c\u91cd\u5b9a\u5411\u6982\u8ff0\u5c31\u5b8c\u6210\u4e86\u3002\u66f4\u591a\u76f8\u5173\u5185\u5bb9\u53ef\u4ee5\u53c2\u8003\u4e86\u89e3\u4e00\u4e0b <a href=\"https:\/\/cn.hostease.com\/blog\/server\/692.html\">\u5982\u4f55\u5728Linux\u670d\u52a1\u5668\u4e0a\u4f7f\u7528IP\u547d\u4ee4<\/a>\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Linux\u7684\u4e00\u4e2a\u6838\u5fc3\u539f\u5219\u662f\uff0c\u8f6f\u4ef6\u5e94\u7528\u7a0b\u5e8f\u5e94\u8be5\u5f88\u5c0f\uff0c\u53ea\u5305\u542b\u5176\u5b8c\u6210\u5de5\u4f5c\u6240\u9700\u7684\u5185\u5bb9\u3002\u4e0e\u5176\u5728\u73b0\u6709\u8f6f\u4ef6\u4e2d\u6784\u5efa\u65b0\u529f\u80fd\uff0c\u4e0d\u5982\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5e94\u7528\u7a0b\u5e8f\u3002\u8fd9\u4e9b\u5c0f\u5e94\u7528\u7a0b\u5e8f\u7684\u8bbe\u8ba1\u76ee\u7684\u901a\u5e38\u4e3a\u534f\u540c\u5de5\u4f5c\uff0c\u5176\u4e2d\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u7684\u8f93\u51fa\u7528\u4f5c\u53e6\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u7684\u8f93\u5165\u3002\u5bf9\u4e8e\u73b0\u4ee3UNIX\u548cLinux\u7cfb\u7edf\u4e0a\u7684\u5927\u591a\u6570\u547d\u4ee4\u884c\u5e94\u7528\u7a0b\u5e8f\uff0c\u8fd9\u4ecd\u7136\u9002\u7528\u3002 \u8f93\u5165\/\u8f93\u51fa\u8bbe\u5907 \u547d\u4ee4\u884c\u5e94 &#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4],"tags":[179],"class_list":["post-702","post","type-post","status-publish","format-standard","hentry","category-shared-hosting","tag-linux"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/posts\/702","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/comments?post=702"}],"version-history":[{"count":2,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/posts\/702\/revisions"}],"predecessor-version":[{"id":22608,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/posts\/702\/revisions\/22608"}],"wp:attachment":[{"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/media?parent=702"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/categories?post=702"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cn.hostease.com\/blog\/wp-json\/wp\/v2\/tags?post=702"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}