{"id":289661,"date":"2024-01-25T05:10:30","date_gmt":"2024-01-24T21:10:30","guid":{"rendered":"https:\/\/lrxjmw.cn\/lhjblmjcxjqd.html"},"modified":"2024-01-25T05:10:30","modified_gmt":"2024-01-24T21:10:30","slug":"lhjblmjcxjqd","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lhjblmjcxjqd.html","title":{"rendered":"Linux\u73af\u5883\u53d8\u91cf\u79d8\u7c4d\uff1a\u67e5\u8be2\u6280\u5de7\u5927\u63ed\u79d8"},"content":{"rendered":"

\u6709\u611f\u4e8e\u5728\u63a2\u7d22Linux<\/a>\u9886\u57df\u8fc7\u7a0b\u4e2d\u73af\u5883\u53d8\u91cf\u7684\u91cd\u8981\u6027linux\u7cfb\u7edf<\/a>\u73af\u5883\u53d8\u91cf\u67e5\u770b<\/strong>\uff0c\u6211\u4eec\u5728\u5b9e\u64cd\u4e2d\u786e\u5b9e\u9047\u5230\u4e86\u4e0d\u5c11\u6d89\u53ca\u73af\u5883\u53d8\u91cf\u7684\u95ee\u9898\u3002\u73b0\u5c06\u8fd9\u4e9b\u7ecf\u9a8c\u4e88\u4ee5\u5206\u4eab\uff0c\u613f\u4e3a\u5404\u4f4d\u670b\u53cb\u63d0\u5347\u5bf9Linux\u7cfb\u7edf\u4e2d\u73af\u5883\u53d8\u91cf\u67e5\u8be2\u6280\u5de7\u7684\u8ba4\u8bc6\u4e0e\u5e94\u7528\u63d0\u4f9b\u5e2e\u52a9\u3002<\/p>\n

1.\u4e86\u89e3\u73af\u5883\u53d8\u91cf\u7684\u6982\u5ff5<\/b><\/p>\n

\u54b1\u4eec\u5148\u6765\u8ba4\u8bc6\u4e00\u4e0b\u73af\u5883\u53d8\u91cf\u5427\uff01\u8fd9\u662f\u5b58\u5728\u4e8e\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7684\u7279\u6b8a\u6570\u503c\uff0c\u5bf9\u7cfb\u7edf\u4ee5\u53ca\u5e94\u7528\u7a0b\u5e8f\u7684\u8fd0\u884c\u8d77\u7740\u91cd\u8981\u4f5c\u7528\u54e6\uff01\u4e3e\u4f8b\u6765\u8bf4\uff0c\u5728Linux\u7cfb\u7edf\u91cc\uff0c\u6211\u4eec\u53ef\u901a\u8fc7\u8bbe\u5b9a\u4e0e\u67e5\u8be2\u8fd9\u4e9b\u73af\u5883\u53d8\u91cf\uff0c\u8f7b\u800c\u6613\u4e3e\u5730\u6253\u9020\u4e2a\u6027\u5316\u7684\u5de5\u4f5c\u73af\u5883\u55bd\uff01<\/p>\n

2.\u4f7f\u7528echo\u547d\u4ee4<\/a>\u67e5\u770b\u5355\u4e2a\u73af\u5883\u53d8\u91cf<\/b><\/p>\n

\u7b80\u800c\u8a00\u4e4b\uff0c\u6211\u4eec\u53ea\u9700\u8981\u901a\u8fc7\u4f7f\u7528 echo \u547d\u4ee4\u5c31\u80fd\u76f4\u89c2\u5730\u67e5\u8be2\u5230\u5404\u7c7b\u73af\u5883\u53d8\u91cf\u7684\u7cbe\u51c6\u6570\u503c\u3002\u6bd4\u5982\uff0c\u82e5\u60a8\u5bf9 PATH \u73af\u5883\u53d8\u91cf\u611f\u5174\u8da3\uff0c\u53ea\u9700\u8981\u5728\u7ec8\u7aef\u4e0a\u6572\u6253\u76f8\u5e94\u547d\u4ee4\u4fbf\u53ef\u3002<\/p>\n

linux\u67e5\u770b\u73af\u5883\u53d8\u91cf\u7684\u547d\u4ee4_linux\u73af\u5883\u53d8\u91cf\u67e5\u770b_linux\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u67e5\u770b<\/p>\n

```<\/p>\n

echo $PATH<\/p>\n

\u7cfb\u7edf\u5c31\u4f1a\u8fd4\u56dePATH\u73af\u5883\u53d8\u91cf\u7684\u503c\u3002<\/p>\n

3.\u4f7f\u7528printenv\u547d\u4ee4\u67e5\u770b\u6240\u6709\u73af\u5883\u53d8\u91cf<\/b><\/p>\n

\u82e5\u60f3\u77e5\u6653\u5168\u90e8\u73af\u5883\u53d8\u91cf\u4fe1\u606f\uff0c\u5efa\u8bae\u4f7f\u7528printenv\u547d\u4ee4;\u638c\u63e1\u65b9\u6cd5\u7b80\u4fbf\u6613\u884c\uff0c\u53ea\u9700\u5728\u6307\u4ee4\u7ec8\u7aef\u8f93\u5165 echo $PATH\u5373\u53ef\u3002<\/p>\n

printenv<\/p>\n

\u7cfb\u7edf\u5c31\u4f1a\u5217\u51fa\u5f53\u524d\u6240\u6709\u7684\u73af\u5883\u53d8\u91cf\u53ca\u5176\u5bf9\u5e94\u7684\u503c\u3002<\/p>\n

4.\u4f7f\u7528set\u547d\u4ee4\u67e5\u770b\u6240\u6709\u73af\u5883\u53d8\u91cf\u548c\u7528\u6237\u5b9a\u4e49\u7684\u53d8\u91cf<\/p>\n

\u9664\u4e86\u719f\u6089\u7684printenv\u6307\u4ee4\u5916\uff0c\u60a8\u4e5f\u53ef\u4ee5\u8bd5\u8bd5set\u547d\u4ee4\u54e6~\u8f93\u5165\u6b64\u7b80\u5355\u547d\u4ee4\u5c31\u80fd\u8f7b\u677e\u67e5\u9605\u6240\u6709\u7684\u73af\u5883\u53d8\u91cf\u548c\u4e2a\u6027\u5316\u8bbe\u7f6e\u5566\uff01<\/p>\n

set<\/p>\n

\u5c0a\u656c\u7684\u5ba2\u6237\uff0c\u8bf7\u5141\u8bb8\u6211\u4e3a\u60a8\u5c55\u793a\u6240\u6709\u7684\u73af\u5883\u548c\u81ea\u5b9a\u4e49\u53d8\u91cf\uff0c\u656c\u8bf7\u671f\u5f85\uff01<\/p>\n

5.\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u67e5\u770b\u73af\u5883\u53d8\u91cf<\/b><\/p>\n

\u5728Linux\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u60a8\u53ef\u4ee5\u67e5\u9605\u914d\u7f6e\u6587\u4ef6\u6765\u83b7\u53d6\u5173\u4e8e\u73af\u5883\u53d8\u91cf\u7684\u8be6\u5c3d\u4fe1\u606f\u3002\u4f8b\u5982\uff0c\/etc\/environment\u8bbe\u5b9a\u7684\u662f\u5168\u5c40\u73af\u5883\u53d8\u91cf\uff0c\u800c\uff5e\/.bashrc\u5219\u662f\u4e3a\u5355\u72ec\u7528\u6237\u63d0\u4f9b\u4e2a\u6027\u5316\u8bbe\u7f6e\u7684\u3002\u53ea\u9700\u5229\u7528\u6587\u672c\u7f16\u8f91\u5de5\u5177linux\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u67e5\u770b<\/strong>\uff0c\u5373\u53ef\u4fbf\u6377\u5730\u6d4f\u89c8\u53ca\u68c0\u9a8c\u4e0a\u8ff0\u73af\u5883\u53d8\u91cf\u7684\u914d\u7f6e\u5185\u5bb9\u3002<\/p>\n

6.\u4f7f\u7528grep\u547d\u4ee4\u641c\u7d22\u6307\u5b9a\u73af\u5883\u53d8\u91cf<\/b><\/p>\n

\u4eb2\u7231\u7684\u5c0f\u4f19\u4f34\u4eec\uff0c\u5982\u679c\u4f60\u6b63\u5728\u627e\u5bfb\u67d0\u4e00\u7279\u6b8a\u73af\u5883\u53d8\u91cf\uff0c\u53ef\u8003\u8651\u5c1d\u8bd5\u4f7f\u7528grep\u6307\u4ee4\u3002\u4f8b\u5982\u67e5\u8be2\u5305\u542b\u5173\u952e\u8bcd\u201cJAVA\u201d\u7684\u73af\u5883\u53d8\u91cf\u65f6\uff0c\u53ea\u9700\u5728\u63a7\u5236\u53f0\u8f93\u5165\u5982\u4e0b\u4e00\u6761\u7b80\u5355\u547d\u4ee4\u5373\u53ef\u5b8c\u6210\u4efb\u52a1\u4e86\u54df\uff01<\/p>\n

linux\u73af\u5883\u53d8\u91cf\u67e5\u770b_linux\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u67e5\u770b_linux\u67e5\u770b\u73af\u5883\u53d8\u91cf\u7684\u547d\u4ee4<\/p>\n

printenv | grep JAVA<\/p>\n

\u7cfb\u7edf\u5c06\u4f1a\u8fd4\u56de\u5305\u542b\"JAVA\"\u5173\u952e\u5b57\u7684\u73af\u5883\u53d8\u91cf\u53ca\u5176\u5bf9\u5e94\u7684\u503c\u3002<\/p>\n

7.\u901a\u8fc7\u914d\u7f6e\u6587\u4ef6\u8bbe\u7f6e\u65b0\u7684\u73af\u5883\u53d8\u91cf<\/b><\/p>\n

\u8bb0\u4f4f\uff0c\u4e0d\u4ec5\u8981\u4e86\u89e3\u5df2\u6709\u73af\u5883\u53d8\u91cf\u7684\u4f5c\u752864\u4f4dlinux\uff0c\u8fd8\u9700\u4e3a\u65b0\u521b\u5efa\u7684\u73af\u5883\u53d8\u91cf\u8fdb\u884c\u5bf9\u5e94\u8bbe\u5b9a\uff0c\u5b83\u7684\u5b8c\u6210\u5e76\u4e0d\u590d\u6742\u3002\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u6211\u4eec\u65e2\u53ef\u4fee\u6539\u7279\u5b9a\u914d\u7f6e\u6587\u4ef6\u7ea2\u65d7linux\u7cfb\u7edf\uff0c\u4ea6\u53ef\u4f7f\u7528export\u547d\u4ee4\u6765\u5b9e\u73b0\u8fd9\u4e00\u6b65\u3002<\/p>\n

8.\u6ce8\u610f\u73af\u5883\u53d8\u91cf\u7684\u4f5c\u7528\u8303\u56f4<\/b><\/p>\n

linux\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u67e5\u770b_linux\u73af\u5883\u53d8\u91cf\u67e5\u770b_linux\u67e5\u770b\u73af\u5883\u53d8\u91cf\u7684\u547d\u4ee4<\/p>\n

\u9996\u5148\u8981\u7406\u89e3\u7684\u662f\uff0c\u73af\u5883\u53d8\u91cf\u5177\u6709\u5168\u7403\u548c\u672c\u5730\u4e24\u79cd\u5c5e\u6027\u3002\u5176\u4e2d\uff0c\u5168\u7403\u73af\u5883\u53d8\u91cf\u9002\u7528\u8303\u56f4\u5e7f\uff0c\u65e0\u8bba\u54ea\u4e2a\u7528\u6237\u6216\u6d41\u7a0b\u90fd\u53ef\u4ee5\u4f7f\u7528\u5230\u5b83\uff1b\u800c\u5c40\u90e8\u73af\u5883\u53d8\u91cf\u5219\u4e3a\u5f53\u524d\u7528\u6237\u53ca\u5176\u8fd0\u884c\u4e2d\u7684\u7a0b\u5e8f\u6240\u72ec\u6709\u3002<\/p>\n

9.\u5c0f\u7ed3<\/b><\/p>\n

\u6b64\u6b21\u5b66\u4e60\u4f7f\u6211\u5bf9Linux\u7cfb\u7edf\u4e0b\u67e5\u8be2\u73af\u5883\u53d8\u91cf\u7684\u7a8d\u95e8\u6709\u4e86\u66f4\u6df1\u5165\u7406\u89e3\u3002\u8fd9\u5bf9\u6539\u5584\u5de5\u4f5c\u73af\u5883\u6709\u76ca\u83f2\u6d45\u3002\u8877\u5fc3\u671f\u671b\u8fd9\u4e9b\u5fc3\u5f97\u80fd\u4e3a\u60a8\u5e26\u6765\u79ef\u6781\u5f71\u54cd\u3002<\/p>\n

\u8fd9\u6b21\u5b9e\u8df5\u8ba9\u6211\u6df1\u523b\u4f53\u4f1a\u5230\u7406\u89e3\u548c\u5e94\u7528Linux\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u7684\u5fc5\u8981\u6027\u3002\u53ea\u6709\u7cbe\u901a\u8fd9\u4e9b\u53d8\u91cf\uff0c\u6211\u4eec\u624d\u80fd\u6253\u9020\u8d34\u5408\u4e2a\u4eba\u9700\u6c42\u7684\u9ad8\u6548\u5de5\u4f5c\u73af\u5883\u3002\u8877\u5fc3\u5e0c\u671b\u672c\u6b21\u5206\u4eab\u80fd\u4e3a\u60a8\u63d0\u4f9b\u7075\u611f\uff0c\u52a9\u60a8\u8fc5\u901f\u9002\u5e94\u5e76\u5145\u5206\u5229\u7528Linux\u4e30\u5bcc\u591a\u6837\u7684\u529f\u80fd\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u73b0\u5c06\u8fd9\u4e9b\u7ecf\u9a8c\u4e88\u4ee5\u5206\u4eab\uff0c\u613f\u4e3a\u5404\u4f4d\u670b\u53cb\u63d0\u5347\u5bf9Linux\u7cfb\u7edf\u4e2d\u73af\u5883\u53d8\u91cf\u67e5\u8be2\u6280\u5de7\u7684\u8ba4\u8bc6\u4e0e\u5e94\u7528\u63d0\u4f9b\u5e2e\u52a9\u3002\u8f93\u5165\u6b64\u7b80\u5355\u547d\u4ee4\u5c31\u80fd\u8f7b\u677e\u67e5\u9605\u6240\u6709\u7684\u73af\u5883\u53d8\u91cf\u548c\u4e2a\u6027\u5316\u8bbe\u7f6e\u5566\uff01\u5728Linux\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u60a8\u53ef\u4ee5\u67e5\u9605\u914d\u7f6e\u6587\u4ef6\u6765\u83b7\u53d6\u5173\u4e8e\u73af\u5883\u53d8\u91cf\u7684\u8be6\u5c3d\u4fe1\u606f\u3002\u6b64\u6b21\u5b66\u4e60\u4f7f\u6211\u5bf9Linux\u7cfb\u7edf\u4e0b\u67e5\u8be2\u73af\u5883\u53d8\u91cf\u7684\u7a8d\u95e8\u6709\u4e86\u66f4\u6df1\u5165\u7406\u89e3\u3002<\/p>\n","protected":false},"author":1,"featured_media":289662,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-289661","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/289661","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=289661"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/289661\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/289662"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=289661"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=289661"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=289661"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}