{"id":104388,"date":"2024-09-18T10:58:10","date_gmt":"2024-09-18T02:58:10","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=104388"},"modified":"2024-09-18T10:58:10","modified_gmt":"2024-09-18T02:58:10","slug":"linux-cmd","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/linux-cmd.html","title":{"rendered":"\u5728Linux \u547d\u4ee4\u884c\u4e0b\u6d4f\u89c8\u5929\u6c14\u9884\u62a5"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\nQ: \u6211\u7ecf\u5e38\u5728 Linux \u684c\u9762\u67e5\u770b\u5929\u6c14\u9884\u62a5\u3002\u7136\u800c\uff0c\u662f\u5426\u6709\u4e00\u79cd\u5728\u7ec8\u7aef\u73af\u5883\u4e0b\uff0c\u4e0d\u901a\u8fc7\u684c\u9762\u5c0f\u63d2\u4ef6\u6216\u8005\u6d4f\u89c8\u5668\u67e5\u8be2\u5929\u6c14\u9884\u62a5\u7684\u65b9\u6cd5?\u5176\u4e2d\u6709\u4e00\u4e2a\u5c31\u662fwego\uff0c\u4e00\u4e2a\u7ec8\u7aef\u4e0b\u7684\u5c0f\u5de7\u7a0b\u5e8f\u3002\u4f7f\u7528\u57fa\u4e8encurses \u7684\u63a5\u53e3\uff0c\u8fd9\u4e2a\u547d\u4ee4\u884c\u7a0b\u5e8f\u5141\u8bb8\u4f60\u67e5\u770b\u5f53\u524d\u7684\u5929\u6c14\u60c5\u51b5\u548c\u4e4b\u540e\u7684\u9884\u62a5\u3002\u5b83\u4e5f\u4f1a\u901a\u8fc7\u4e00\u4e2a\u5929\u6c14\u9884\u62a5\u7684API \u6536\u96c6\u63a5\u4e0b\u67655 \u5929\u7684\u5929\u6c14\u9884\u62a5\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

\u5728Linux \u4e0b\u5b89\u88c5 wego<\/p>\n

\u5b89\u88c5 wego \u76f8\u5f53\u7b80\u5355\u3002wego \u662f\u7528 Go \u7f16\u5199\u7684\uff0c\u5f15\u8d77\u7b2c\u4e00\u4e2a\u6b65\u9aa4\u5c31\u662f\u5b89\u88c5Go \u8bed\u8a00\u3002\u7136\u540e\u518d\u5b89\u88c5 wego\u3002<\/p>\n

$ go get github.com\/schachmat\/wego<\/pre>\n

wego \u4f1a\u88ab\u5b89\u88c5\u5230 $GOPATH\/bin\uff0c\u6240\u4ee5\u8981\u5c06 $GOPATH\/bin \u6dfb\u52a0\u5230 $PATH \u73af\u5883\u53d8\u91cf\u3002<\/p>\n

$ echo'export PATH=\"$PATH:$GOPATH\/bin\"'>>~\/.bashrc\r\n\r\n$ source ~\/.bashrc<\/pre>\n

\u73b0\u5728\u5c31\u53ef\u4e0e\u76f4\u63a5\u4ece\u547d\u4ee4\u884c\u542f\u52a8 wego \u4e86\u3002<\/p>\n

$ wego<\/pre>\n

\u7b2c\u4e00\u6b21\u8fd0\u884c weg \u4f1a\u751f\u6210\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6(~\/.wegorc)\uff0c\u4f60\u9700\u8981\u6307\u5b9a\u4e00\u4e2a\u5929\u6c14 API key\u3002 \u4f60\u53ef\u4ee5\u4ece worldweatheronline.com \u83b7\u53d6\u4e00\u4e2a\u514d\u8d39\u7684 API key\u3002\u514d\u8d39\u6ce8\u518c\u548c\u4f7f\u7528\u3002\u4f60\u53ea\u9700\u8981\u63d0\u4f9b\u4e00\u4e2a\u6709\u6548\u7684\u90ae\u7bb1\u5730\u5740\u3002<\/p>\n

\"\"<\/p>\n

\u3000\u3000\u4f60\u7684 .wegorc \u914d\u7f6e\u6587\u4ef6\u770b\u8d77\u6765\u4f1a\u8fd9\u6837\uff1a<\/p>\n

\"\"<\/p>\n

\u3000\u3000\u9664\u4e86 API key\uff0c\u4f60\u8fd8\u53ef\u4ee5\u628a\u4f60\u60f3\u8981\u67e5\u8be2\u5929\u6c14\u7684\u5730\u65b9\u3001\u4f7f\u7528\u7684\u57ce\u5e02\/\u56fd\u5bb6\u540d\u79f0\u3001\u8bed\u8a00\u914d\u7f6e\u5728 ~\/.wegorc \u4e2d\u3002 \u6ce8\u610f\uff0c\u8fd9\u4e2a\u5929\u6c14 API \u7684\u4f7f\u7528\u6709\u9650\u5236\uff1a\u6bcf\u79d2\u6700\u591a 5 \u6b21\u67e5\u8be2\uff0c\u6bcf\u5929\u6700\u591a 250 \u6b21\u67e5\u8be2\u3002 \u5f53\u4f60\u91cd\u65b0\u6267\u884c wego \u547d\u4ee4\uff0c\u4f60\u5c06\u4f1a\u770b\u5230\u6700\u65b0\u7684\u5929\u6c14\u9884\u62a5(\u5f53\u7136\u662f\u4f60\u7684\u6307\u5b9a\u5730\u65b9)\uff0c\u5982\u9898\u56fe\u663e\u793a\u3002<\/p>\n

\u663e\u793a\u51fa\u6765\u7684\u5929\u6c14\u4fe1\u606f\u5305\u62ec\uff1a(1)\u6e29\u5ea6\uff0c(2)\u98ce\u901f\u548c\u98ce\u5411\uff0c(3)\u53ef\u89c6\u8ddd\u79bb\uff0c(4)\u964d\u6c34\u91cf\u548c\u964d\u6c34\u6982\u7387 \u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4f1a\u663e\u793a3 \u5929\u7684\u5929\u6c14\u9884\u62a5\u3002\u5982\u679c\u8981\u8fdb\u884c\u4fee\u6539\uff0c\u53ef\u4ee5\u901a\u8fc7\u53c2\u6570\u6539\u53d8\u5929\u6c14\u8303\u56f4(\u6700\u591a5\u5929)\uff0c\u6bd4\u5982\u8981\u67e5\u770b5 \u5929\u7684\u5929\u6c14\u9884\u62a5\uff1a<\/p>\n

$ wego 5<\/pre>\n

\u5982\u679c\u4f60\u60f3\u68c0\u67e5\u53e6\u4e00\u4e2a\u5730\u65b9\u7684\u5929\u6c14\uff0c\u53ea\u9700\u8981\u63d0\u4f9b\u57ce\u5e02\u540d\u5373\u53ef\uff1a<\/p>\n

$ wego Seattle<\/pre>\n

\u95ee\u9898\u89e3\u51b3<\/p>\n

\u53ef\u80fd\u4f1a\u9047\u5230\u4e0b\u9762\u7684\u9519\u8bef\uff1a
\nuser:Currentnot implemented on linux\/amd64<\/span><\/p>\n

\u5f53\u4f60\u5728\u4e00\u4e2a\u4e0d\u652f\u6301\u539f\u751f Go \u7f16\u8bd1\u5668\u7684\u73af\u5883\u4e0b\u8fd0\u884c wego \u65f6\u5c31\u4f1a\u51fa\u73b0\u8fd9\u4e2a\u9519\u8bef\u3002\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u4f60\u53ea\u9700\u8981\u4f7f\u7528 gccgo \u2014\u2014\u4e00\u4e2a Go \u7684\u7f16\u8bd1\u5668\u524d\u7aef\u6765\u7f16\u8bd1\u7a0b\u5e8f\u5373\u53ef\u3002\u8fd9\u4e00\u6b65\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u7684\u547d\u4ee4\u5b8c\u6210\u3002<\/p>\n

$ sudoyum install gcc-go\r\n\r\n$ go get-compiler=gccgo github.com\/schachmat\/wego<\/pre>\n

\u4ee5\u4e0a\u5c31\u662f\u5728Linux \u547d\u4ee4\u884c\u4e0b\u6d4f\u89c8\u5929\u6c14\u9884\u62a5\u7684\u65b9\u6cd5\uff0c\u5e0c\u671b\u5bf9\u5927\u5bb6\u7684\u5b66\u4e60\u6709\u6240\u5e2e\u52a9\u3002<\/p>\n

\n

\u539f\u6587\u6765\u81ea\uff1ahttp:\/\/www.jsgho.net\/help\/fwq\/23212.html<\/a><\/p>\n

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

\u5bfc\u8bfb Q: \u6211\u7ecf\u5e38\u5728 Linux \u684c\u9762\u67e5\u770b\u5929\u6c14\u9884\u62a5\u3002\u7136\u800c\uff0c\u662f\u5426\u6709\u4e00\u79cd\u5728\u7ec8\u7aef\u73af\u5883\u4e0b\uff0c\u4e0d\u901a\u8fc7\u684c\u9762\u5c0f\u63d2\u4ef6\u6216\u8005\u6d4f\u89c8\u5668\u67e5 […]<\/p>\n","protected":false},"author":63,"featured_media":104115,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-104388","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\/104388","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=104388"}],"version-history":[{"count":4,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/104388\/revisions"}],"predecessor-version":[{"id":293037,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/104388\/revisions\/293037"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/104115"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=104388"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=104388"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=104388"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}