{"id":56676,"date":"2023-07-15T13:53:14","date_gmt":"2023-07-15T05:53:14","guid":{"rendered":"http:\/\/lrxjmw.cn\/?p=56676"},"modified":"2023-07-15T13:53:14","modified_gmt":"2023-07-15T05:53:14","slug":"shell-command","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/shell-command.html","title":{"rendered":"Shell\u4e2d4\u4e2a\u5173\u952e\u7684\u7f51\u7edc\u547d\u4ee4"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nshell\u662f\u6211\u4eec\u5728linux\u4e2d\u5e38\u7528\u7684\uff0c\u90a3\u4e48\u5728\u8fd9\u91cc\u8ddf\u5927\u5bb6\u5206\u4eab\u8fd9\u4e2a\u76f8\u5173\u7684\u4e00\u4e9b\u547d\u4ee4\uff0c\u8fd9\u7bc7\u6587\u7ae0\u4e2d\u6211\u4ecb\u7ecd\u51e0\u4e2a\u975e\u5e38\u5b9e\u7528\u7684\u548c\u7f51\u7edc\u76f8\u5173\u7684\u547d\u4ee4\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n
ifconfig<\/strong><\/div>\n

\u8fd9\u4e2a\u547d\u4ee4\u4e0eWindows\u7684\u201cipconfig\u201d\u4f5c\u7528\u4e00\u81f4\uff0c\u7528\u4e8e\u663e\u793a\u7f51\u7edc\u63a5\u53e3\uff0c\u5b50\u7f51\u63a9\u7801\u7b49\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n

ifconfig \u5de6\u8fb9\u4e00\u5217\u662f\u7f51\u7edc\u63a5\u53e3\u540d\uff0c\u5360\u636e10\u4e2a\u5b57\u8282\uff0c\u53f3\u8fb9\u7684\u82e5\u5e72\u5217\u663e\u793a\u5bf9\u5e94\u7684\u7f51\u7edc\u63a5\u53e3\u7684\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n

\u5728\u6bcf\u4e2a\u7cfb\u7edf\u4e2d\uff0c\u9ed8\u8ba4\u90fd\u6709\u4e00\u4e2a\u79f0\u4e4b\u4e3a\u73af\u56de\u63a5\u53e3\u7684lo\uff0c\u8fd9\u4e2a\u63a5\u53e3\u6307\u5411\u5f53\u524d\u4e3b\u673a\u672c\u8eab\u3002<\/p>\n

\u4e0b\u9762\u8fd9\u5f20\u622a\u56fe\u662f\u5728\u535a\u4e3b\u7684\u7535\u8111\u4e0a\u8fd0\u884c\u8fd9\u4e2a\u547d\u4ee4\u4e4b\u540e\u663e\u793a\u7684\u4fe1\u606f\uff1a<\/p>\n

\"Shell\u4e2d4\u4e2a\u7f51\u7edc\u76f8\u5173\u547d\u4ee4\u7684\u4f7f\u7528\u6280\u5de7\"<\/p>\n

\u76f8\u5173\u6280\u5de7\uff1a<\/p>\n

1.\u6253\u5370\u7f51\u7edc\u63a5\u53e3\u5217\u8868<\/strong><\/p>\n

\"Shell\u4e2d4\u4e2a\u7f51\u7edc\u76f8\u5173\u547d\u4ee4\u7684\u4f7f\u7528\u6280\u5de7\"<\/p>\n

\u8bf4\u660e\uff1aifconfig \u8f93\u51fa\u7684\u7b2c\u4e00\u5217\u7684\u524d\u5341\u4e2a\u5b57\u8282\u663e\u793a\u7684\u7f51\u7edc\u63a5\u53e3\u540d\uff0c\u56e0\u6b64\u6211\u4eec\u7528 cut \u547d\u4ee4\u63d0\u53d6\u6bcf\u4e00\u884c\u7684\u524d10\u4e2a\u5b57\u7b26\u3002<\/p>\n

\u8fd0\u884c\u622a\u56fe\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

\"Shell\u4e2d4\u4e2a\u7f51\u7edc\u76f8\u5173\u547d\u4ee4\u7684\u4f7f\u7528\u6280\u5de7\"<\/p>\n

2.\u786c\u4ef6\u5730\u5740(MAC\u5730\u5740)\u6b3a\u9a97<\/strong><\/p>\n

\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\uff0c\u9700\u8981\u5229\u7528\u786c\u4ef6\u5730\u5740\u5bf9\u7f51\u7edc\u4e0a\u7684\u8ba1\u7b97\u673a\u8fdb\u884c\u8ba4\u8bc1\u6216\u8fc7\u6ee4\uff0c\u5bf9\u6b64\uff0c\u6211\u4eec\u53ef\u4ee5\u5229\u7528\u786c\u4ef6\u5730\u5740\u6b3a\u9a97<\/p>\n

\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n

\"Shell\u4e2d4\u4e2a\u7f51\u7edc\u76f8\u5173\u547d\u4ee4\u7684\u4f7f\u7528\u6280\u5de7\"<\/p>\n

\u8ba9\u6211\u4eec\u8fd0\u884c\u4e0b\u770b\u770b\u7ed3\u679c\uff1a<\/p>\n

\"Shell\u4e2d4\u4e2a\u7f51\u7edc\u76f8\u5173\u547d\u4ee4\u7684\u4f7f\u7528\u6280\u5de7\"<\/p>\n

\u6ce8\uff1a\u8fd9\u4e2a\u547d\u4ee4\u9700\u8981\u4f7f\u7528root\u6743\u9650<\/p>\n

host \u548c nslookup<\/strong><\/div>\n

\u8fd9\u4e24\u4e2a\u547d\u4ee4\u662fDNS\u67e5\u627e\u5de5\u5177<\/p>\n

\u5f53\u6267\u884chost \u65f6\uff0c\u5b83\u4f1a\u5217\u51fa\u67d0\u4e2a\u57df\u540d\u7684\u6240\u6709IP \u5730\u5740;nslookup \u662f\u4e00\u4e2a\u7c7b\u4f3c\u4e8ehost \u7684\u547d\u4ee4\uff0c\u5b83\u7528\u4e8e\u67e5\u8be2DNS \u76f8\u5173\u7684\u7ec6\u8282\u4fe1\u606f\u4ee5\u53ca\u540d\u5b57\u89e3\u6790\u3002<\/p>\n

\u5982\u4e0b\u622a\u56fe\u662f\u5728\u535a\u4e3b\u7684\u7535\u8111\u4e0a\u67e5\u8be2 www.baidu.com \u7684 IP \u5730\u5740\uff1a<\/p>\n

\"Shell\u4e2d4\u4e2a\u7f51\u7edc\u76f8\u5173\u547d\u4ee4\u7684\u4f7f\u7528\u6280\u5de7\"<\/p>\n

route<\/strong><\/div>\n

\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7ef4\u62a4\u7740\u4e00\u4e2a\u88ab\u79f0\u4e3a\u8def\u7531\u8868\u7684\u8868\u683c\uff0c\u5b83\u5305\u542b\u4e86\u5173\u4e8e\u5206\u7ec4\u5982\u4f55\u8f6c\u53d1\u4ee5\u53ca\u901a\u8fc7\u7f51\u7edc\u4e2d\u7684\u54ea\u4e9b\u8282\u70b9\u8f6c\u53d1\u7684\u4fe1\u606f\uff0c\u53ef\u4ee5\u7528\u4e0b\u9762\u7684\u65b9\u6cd5\u663e\u793a\u8def\u7531\u8868<\/p>\n

\"Shell\u4e2d4\u4e2a\u7f51\u7edc\u76f8\u5173\u547d\u4ee4\u7684\u4f7f\u7528\u6280\u5de7\"<\/p>\n

-n\u6307\u5b9a\u4ee5\u6570\u5b57\u5f62\u5f0f\u663e\u793a\u5730\u5740\u3002<\/p>\n

\u622a\u56fe\u5982\u4e0b\u6240\u793a\uff1a<\/p>\n

\"Shell\u4e2d4\u4e2a\u7f51\u7edc\u76f8\u5173\u547d\u4ee4\u7684\u4f7f\u7528\u6280\u5de7\"<\/p>\n

traceroute<\/strong><\/div>\n

\u8fd9\u4e2a\u547d\u4ee4\u53ef\u4ee5\u663e\u793a\u5206\u7ec4\u9014\u5f84\u7684\u6240\u6709\u7f51\u5173\u5730\u5740\u3002traceroute\u4fe1\u606f\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u641e\u660e\u767d\u5206\u7ec4\u5230\u8fbe\u76ee\u7684\u5730\u9700\u8981\u7ecf\u8fc7\u591a\u5c11\u8df3\u3002\u4e2d\u9014\u7684\u7f51\u5173\u6216\u8def\u7531\u5668\u7684\u6570\u91cf\u7ed9\u51fa\u4e86\u4e00\u4e2a\u6d4b\u91cf\u7f51\u7edc\u4e0a\u4e24\u4e2a\u8282\u70b9\u76f4\u63a5\u8ddd\u79bb\u7684\u5ea6\u91cf\u3002<\/p>\n

\u540c\u6837\u7684\uff0c\u6211\u4eec\u770b\u4e0b\u622a\u56fe\uff1a<\/p>\n

\u5728\u8fd9\u91cc\uff0c\u535a\u4e3b\u67e5\u8be2www.baidu.com \u7684\u5206\u7ec4\u8f6c\u53d1\u4fe1\u606f\uff1a<\/p>\n

\"Shell\u4e2d4\u4e2a\u7f51\u7edc\u76f8\u5173\u547d\u4ee4\u7684\u4f7f\u7528\u6280\u5de7\"<\/p>\n

\u7531\u6b64\u53ef\u89c1\uff0c\u5230\u8fbe\u767e\u5ea6\u9700\u8981\u7ecf\u8fc712\u8df3\u3002<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/os.51cto.com\/art\/201703\/535424.htm<\/a><\/p>\n

\u672c\u6587\u5730\u5740\uff1ahttp:\/\/lrxjmw.cn\/shell-command.html<\/a>\u7f16\u8f91\u5458\uff1a\u90dd\u5927\u53d1\uff0c\u5ba1\u6838\u5458\uff1a\u9004\u589e\u5b9d<\/span><\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"

\u8fd9\u7bc7\u6587\u7ae0\u4e2d\u6211\u4ecb\u7ecd\u51e0\u4e2a\u975e\u5e38\u5b9e\u7528\u7684\u548c\u7f51\u7edc\u76f8\u5173\u7684\u547d\u4ee4\u3002ifconfig\u8fd9\u4e2a\u547d\u4ee4\u4e0eWindows\u7684“ipconfig”\u4f5c\u7528\u4e00\u81f4\uff0c\u7528\u4e8e\u663e\u793a\u7f51\u7edc\u63a5\u53e3\uff0c\u5b50\u7f51\u63a9\u7801\u7b49\u8be6\u7ec6\u4fe1\u606f\u3002<\/p>\n","protected":false},"author":63,"featured_media":61050,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-56676","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/56676","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=56676"}],"version-history":[{"count":8,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/56676\/revisions"}],"predecessor-version":[{"id":277568,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/56676\/revisions\/277568"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/61050"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=56676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=56676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=56676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}