{"id":291227,"date":"2024-05-01T05:13:40","date_gmt":"2024-04-30T21:13:40","guid":{"rendered":"https:\/\/lrxjmw.cn\/lhjbltzclsrl.html"},"modified":"2024-05-01T05:13:40","modified_gmt":"2024-04-30T21:13:40","slug":"lhjbltzclsrl","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lhjbltzclsrl.html","title":{"rendered":"Linux\u73af\u5883\u53d8\u91cf\u8c03\u6574\u7b56\u7565\uff1a\u6df1\u5165\u7406\u89e3\u4e0e\u5b9e\u8df5\u6280\u5de7"},"content":{"rendered":"

\u5728Linux<\/a>\u7cfb\u7edf<\/a>\u4e2d\uff0c\u73af\u5883\u53d8\u91cf\u8d1f\u8d23\u8bbe\u7f6e\u57fa\u7840\u8fd0\u884c\u53c2\u6570\u7684\u5173\u952e\u529f\u80fd\uff0c\u5b9e\u8df5\u8fd0\u7528\u65f6\uff0c\u987b\u4f9d\u636e\u4e0d\u540c\u9700\u6c42\u800c\u5bf9\u5176\u5b9e\u65bd\u5fc5\u8981\u7684\u8c03\u6574\uff0c\u4ee5\u9002\u5e94\u5404\u7c7b\u7279\u6b8a\u9700\u8981\u53ca\u5e94\u7528\u573a\u666f\u3002\u672c\u7bc7\u5c06\u4f1a\u6df1\u5165\u9610\u8ff0Linux\u73af\u5883\u53d8\u91cf\u8c03\u6574\u7684\u7b56\u7565\uff0c\u5e76\u62ab\u9732\u4e0e\u5176\u7d27\u5bc6\u5173\u8054\u7684\u6838\u5fc3\u6982\u5ff5\u4e0e\u64cd\u4f5c\u6280\u80fd\u3002<\/p>\n

\u4ec0\u4e48\u662f\u73af\u5883\u53d8\u91cf<\/b><\/p>\n

\u5bf9\u73af\u5883\u53d8\u91cf\u7684\u8bbe\u7f6e\u4e0e\u8c03\u6574\u9700\u8981\u6df1\u5165\u7406\u89e3\u5176\u5b9a\u4e49\u53ca\u5176\u529f\u80fd\u3002\u73af\u5883\u53d8\u91cf\u662f\u6307\u8ba1\u7b97\u673a\u7cfb\u7edf\u5185\u90e8\u901a\u8fc7\u7279\u5b9a\u7f16\u7801\u5b58\u50a8\u7684\u5b9e\u65f6\u6570\u503c\uff0c\u7528\u4e8e\u6ee1\u8db3\u591a\u6837\u5316\u5e94\u7528\u9700\u6c42\uff0c\u5305\u62ec\u8bbe\u5b9a\u7cfb\u7edf\u8def\u5f84\u3001\u521b\u5efa\u4e2a\u6027\u5316\u5de5\u4f5c\u73af\u5883\u4ee5\u53ca\u914d\u7f6e\u8f6f\u4ef6\u53c2\u6570\u7b49\u3002\u5728Linux\u64cd\u4f5c\u7cfb\u7edf\u4e2d\uff0c\u8fd9\u7c7b\u53d8\u91cf\u901a\u5e38\u91c7\u7528\u5927\u5199\u7f29\u5199\u5f62\u5f0f\u5448\u73b0\uff0c\u5982\u5e38\u89c1\u7684PATH\u548cHOME\u7b49\u3002<\/p>\n

\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u6bcf\u4f4d\u7528\u6237\u5747\u62e5\u6709\u72ec\u81ea\u7684\u73af\u5883\u53d8\u91cf\u8bbe\u5b9a\u6743\u9650\uff0c\u540c\u65f6\u4ea6\u63d0\u4f9b\u4e86\u5168\u7403\u8303\u56f4\u5185\u53ef\u4f9b\u516c\u7528\u7684\u73af\u5883\u53d8\u91cf\u3002\u6df1\u5165\u4e86\u89e3\u53ca\u7075\u6d3b\u8fd0\u7528\u6b64\u7c7b\u73af\u5883\u53d8\u91cflinux\u4e2d\u5982\u4f55\u4fee\u6539\u73af\u5883\u53d8\u91cf<\/strong>linux\u865a\u62df\u673a\uff0c\u5bf9\u4e8e\u7cfb\u7edf\u7ba1\u7406\u53ca\u8f6f\u4ef6\u5f00\u53d1\u5177\u6709\u91cd\u8981\u610f\u4e49\u3002<\/p>\n

\u67e5\u770b\u73af\u5883\u53d8\u91cf<\/b><\/p>\n

\u5728\u8fdb\u884c\u73af\u5883\u53d8\u91cf\u8c03\u6574\u4e0e\u65b0\u5efa\u524d\uff0c\u9996\u5148\u638c\u63e1\u73b0\u5b58\u8bbe\u7f6e\u662f\u5fc5\u8981\u7684\u3002\u4ec5\u51ed\u82e5\u5e72\u7b80\u6613\u6307\u4ee4\uff08\u5982`printenv`\u548c`env`\uff09\uff0c\u4fbf\u80fd\u8f7b\u6613\u83b7\u5f97\u5e76\u7406\u89e3\u5f53\u524d\u6240\u6709\u73af\u5883\u53d8\u91cf\u53ca\u5176\u5177\u4f53\u6570\u503c\u3002<\/p>\n

linux\u4e2d\u5982\u4f55\u4fee\u6539\u73af\u5883\u53d8\u91cf_linux\u4fee\u6539\u53d8\u91cf\u503c_linux\u4fee\u6539\u73af\u5883\u53d8\u91cf\u7684\u503c<\/p>\n

\n

bash\nprintenv\n<\/pre>\n<\/p>\n

\u6b64\u6307\u4ee4\u660e\u786e\u5217\u51fa\u5e76\u8be6\u7ec6\u8bf4\u660e\u5df2\u914d\u7f6e\u7684\u6240\u6709\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u53ca\u5176\u8d4b\u503c\u72b6\u51b5linux\u4e2d\u5982\u4f55\u4fee\u6539\u73af\u5883\u53d8\u91cf<\/strong>\uff0c\u4ee5\u4fbf\u7528\u6237\u80fd\u6df1\u523b\u7406\u89e3\u5f53\u524d\u7684\u7cfb\u7edf\u73af\u5883\u72b6\u51b5\uff0c\u5e76\u4e3a\u540e\u7eed\u64cd\u4f5c\u5e26\u6765\u4fbf\u5229\u6027\u7684\u6307\u5bfc\u3002<\/p>\n

\u4fee\u6539\u73af\u5883\u53d8\u91cf\u7684\u65b9\u6cd5<\/b><\/p>\n

\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u53ef\u91c7\u7528\u591a\u79cd\u9014\u5f84\u3002\u666e\u904d\u7684\u505a\u6cd5\u662f\u7f16\u8f91\u76f8\u5173\u914d\u7f6e\u6587\u4ef6\uff0c\u6216\u8005\u8fd0\u7528`export`\u547d\u4ee4<\/a>\u8fdb\u884c\u6682\u65f6\u4fee\u6539\uff1b\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7\u7279\u5b9a\u7684`.profile`\u548c`.bashrc`\u6587\u4ef6\u5b9e\u73b0\u957f\u671f\u8bbe\u5b9a\u3002<\/p>\n

1.\u76f4\u63a5\u4fee\u6539\u914d\u7f6e\u6587\u4ef6<\/b><\/p>\n

\u5728Linux\u73af\u5883\u4e0b\uff0c\u73af\u5883\u53d8\u91cf\u901a\u5e38\u6839\u636e\u914d\u7f6e\u6587\u4ef6\u6765\u8bbe\u5b9a\uff0c\u7528\u6237\u53ef\u6839\u636e\u4e2a\u4eba\u9700\u6c42\u5bf9\u5176\u8fdb\u884c\u8c03\u6574\u3002\u5e38\u7528\u7684\u914d\u7f6e\u6587\u4ef6\u6709`\/etc\/profile`\uff0c`\/etc\/environment`\uff0c`~\/.bash_profile`\u548c`~\/.bashrc`\u3002\u5229\u7528\u8fd9\u4e9b\u6587\u4ef6\uff0c\u7528\u6237\u53ef\u4ee5\u65b9\u4fbf\u5730\u8fdb\u884c\u73af\u5883\u53d8\u91cf\u7684\u589e\u5220\u4fee\u67e5\u7b49\u5de5\u4f5c\u3002<\/p>\n

sudovi\/etc\/profile<\/p>\n

\u6309\u7167\u8bf4\u660e\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7vi\u6587\u672c\u7f16\u8f91\u5668\u5f00\u542f\/etc\/profile\u914d\u7f6e\u6587\u4ef6\uff0c\u4ece\u800c\u8c03\u6574\u548c\u589e\u8bbe\u73af\u5883\u53d8\u91cf\u3002\u4fee\u6539\u5b8c\u6bd5\u540e\uff0c\u9700\u91cd\u65b0\u542f\u52a8\u7ec8\u7aef\u6216\u8f93\u5165`source\/etc\/profile`\u6307\u4ee4\u6765\u5b9e\u73b0\u5373\u65f6\u751f\u6548\u3002<\/p>\n

2.\u4f7f\u7528export\u547d\u4ee4\u4e34\u65f6\u4fee\u6539<\/b><\/p>\n

\u5229\u7528`export`\u547d\u4ee4\uff0c\u7528\u6237\u53ef\u4ee5\u8f7b\u677e\u5730\u6839\u636e\u9700\u8981\u5bf9\u73af\u5883\u53d8\u91cf\u8fdb\u884c\u4e34\u65f6\u8bbe\u7f6e\u3002\u4f7f\u7528\u8be5\u547d\u4ee4\u65f6\uff0c\u53ea\u9700\u9075\u5faa\u89c4\u5219\u201c`export\u53d8\u91cf\u540d=\u503c’\u201d\u4fbf\u80fd\u7acb\u5373\u53d8\u66f4\u5f53\u524d\u4f1a\u8bdd\u4e0b\u7684\u73af\u5883\u53d8\u91cf\u8bbe\u5b9a\u3002<\/p>\n

\u672c\u65b9\u6cd5\u4f18\u5316\u4e86\u7cfb\u7edf\u73af\u5883\u53c2\u6570\uff0c\u5c06\/usr\/local\/bin\u6dfb\u52a0\u81f3\u9ed8\u8ba4\u641c\u7d22\u8def\u5f84\u8303\u7574\u5185\u3002<\/p>\n

\u4ee5\u6b64\u6307\u4ee4\u7684\u5b9e\u65bd\uff0c\u5c06\u4f7f\u5f97\/usr\/local\/bin\u88ab\u6dfb\u52a0\u81f3\u5f53\u524d\u4f1a\u8bdd\u4e2d\u7684PATH\u73af\u5883\u53d8\u91cf\u4e4b\u4e2d\uff0c\u4ece\u800c\u4f7f\u64cd\u4f5c\u7cfb\u7edf\u5f97\u4ee5\u5728\u6b64\u8def\u5f84\u5185\u8bc6\u522b\u5e76\u542f\u52a8\u53ef\u6267\u884c\u7a0b\u5e8f\u3002<\/p>\n

3.\u5728\u7528\u6237\u914d\u7f6e\u6587\u4ef6\u4e2d\u6c38\u4e45\u4fee\u6539<\/b><\/p>\n

\u4e3a\u786e\u4fdd\u6bcf\u6b21\u767b\u5165\u540e\u73af\u5883\u53d8\u91cf\u80fd\u5373\u523b\u751f\u6548\uff0c\u5efa\u8bae\u60a8\u5c06\u66f4\u65b0\u5185\u5bb9\u6dfb\u52a0\u81f3\u4e2a\u4eba\u914d\u7f6e\u6587\u6863\u4e2d\u3002\u4e00\u822c\u800c\u8a00\uff0c\u6b64\u7c7b\u6587\u6863\u4f4d\u4e8e\u5bb6\u76ee\u5f55\u4e2d\u7684`.profile`\u6216`.bashrc`\u6587\u4ef6\u5185\u3002\u60a8\u53ef\u5bf9\u6b64\u7c7b\u6587\u4ef6\u8fdb\u884c\u7f16\u8f91\uff0c\u4ee5\u6dfb\u52a0\u6240\u9700\u7684\u73af\u5883\u53d8\u91cf\u8bbe\u5b9a\u3002<\/p>\n

vi~\/.bashrc<\/p>\n

\u6839\u636e\u4e0a\u8ff0\u64cd\u4f5c\u6307\u4ee4\uff0c\u5728VI\u7f16\u8f91\u5668\u4e2d\u7528\u6237\u53ef\u81ea\u4e3b\u8c03\u6574\u4e0e\u8c03\u8bd5\u5176`.bashrc`\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u73af\u5883\u53d8\u91cf\u8bbe\u7f6e\u3002\u8c03\u6574\u5b8c\u6bd5\u540e\uff0c\u52a1\u5fc5\u8fd0\u884c`source~\/.bashrc`\u4f7f\u4fee\u6539\u751f\u6548\u3002<\/p>\n

\u6ce8\u610f\u4e8b\u9879<\/b><\/p>\n

\u5728\u4fee\u6539\u73af\u5883\u53d8\u91cf\u65f6\uff0c\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n

\u8bf7\u6ce8\u610f\uff0c\u66f4\u6539\u73af\u5883\u53d8\u91cf\u4f1a\u5bf9\u7cfb\u7edf\u548c\u8f6f\u4ef6\u7684\u6b63\u5e38\u8fd0\u4f5c\u9020\u6210\u6f5c\u5728\u5a01\u80c1\uff0c\u6545\u9700\u614e\u91cd\u64cd\u4f5c\uff0c\u4ee5\u9632\u4e0d\u6d4b\u72b6\u51b5\u7684\u51fa\u73b0\u3002<\/p>\n

\u5728\u8c03\u6574\u64cd\u4f5c\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u524d\uff0c\u52a1\u5fc5\u5bf9\u76f8\u5173\u914d\u7f6e\u6587\u4ef6\u8fdb\u884c\u59a5\u5584\u5907\u4efd\uff0c\u9884\u9632\u610f\u5916\u60c5\u51b5\u53d1\u751f\uff0c\u4ee5\u51cf\u5c11\u4e0d\u5fc5\u8981\u7684\u9ebb\u70e6\u3002<\/p>\n

linux\u4e2d\u5982\u4f55\u4fee\u6539\u73af\u5883\u53d8\u91cf_linux\u4fee\u6539\u73af\u5883\u53d8\u91cf\u7684\u503c_linux\u4fee\u6539\u53d8\u91cf\u503c<\/p>\n

\u5728\u6539\u52a8\u73af\u5883\u53d8\u91cf\u540e\uff0c\u9700\u6ce8\u610f\u767b\u51fa\u5e76\u91cd\u542f\u914d\u7f6e\u6587\u4ef6\u4ee5\u786e\u4fdd\u66f4\u6539\u751f\u6548\u3002<\/p>\n

\u8fd0\u7528\u6b64\u65b9\u6cd5\uff0c\u4f7f\u7528\u8005\u53ef\u4ee5\u8f7b\u677e\u81ea\u5982\u5730\u5bf9Linux\u7cfb\u7edf\u7684\u73af\u5883\u53c2\u6570\u8fdb\u884c\u8c03\u6574\uff0c\u4ee5\u9002\u5e94\u5404\u79cd\u4e0d\u540c\u9700\u6c42\u548c\u5e94\u7528\u573a\u666f\u3002<\/p>\n

\u603b\u7ed3\u4e0e\u5c55\u671b<\/b><\/p>\n

\u672c\u6587\u6df1\u5165\u5256\u6790\u4e86Linux\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u7684\u7cbe\u51c6\u8bbe\u7f6e\u4e0e\u7b56\u7565\u6307\u5f15\u3002\u6587\u7ae0\u8be6\u8ff0\u73af\u5883\u53d8\u91cf\u7684\u5b9a\u4e49\u53ca\u5176\u67e5\u8be2\u53ca\u8c03\u6574\u65b9\u6cd5\uff0c\u4ee5\u671f\u63d0\u5347\u8bfb\u8005\u5bf9Linux\u73af\u5883\u53d8\u91cf\u7684\u8ba4\u8bc6\u6c34\u5e73\u53ca\u5b9e\u8df5\u80fd\u529b\u3002\u6b64\u9879\u6280\u80fd\u5728\u5b9e\u9645\u8fd0\u7528\u4e2d\u6709\u52a9\u4e8e\u7528\u6237\u66f4\u6709\u6548\u5730\u8fdb\u884c\u7cfb\u7edf\u7ba1\u7406\u548c\u8f6f\u4ef6\u914d\u7f6e\uff0c\u4ece\u800c\u63d0\u9ad8\u5de5\u4f5c\u6548\u80fd\u3002<\/p>\n

\u4e0d\u4e45\u672a\u6765\uff0cLinux\u64cd\u4f5c\u7cfb\u7edf\u5c06\u6301\u7eed\u521b\u65b0\uff0c\u81f4\u529b\u4e8e\u6784\u5efa\u66f4\u52a0\u667a\u80fd\u3001\u4fbf\u6377\u7684\u73af\u5883\u53d8\u91cf\u7ba1\u7406\u4f53\u7cfb\u3002\u501f\u52a9\u5148\u8fdb\u6280\u672f\u4e0e\u521b\u65b0\u89e3\u51b3\u65b9\u6848\u7684\u63a8\u52a8linux\u91cd\u542f\u547d\u4ee4\uff0c\u65e8\u5728\u4e3a\u5e7f\u5927Linux\u7528\u6237\u5e26\u6765\u5353\u8d8a\u7684\u4f7f\u7528\u4f53\u9a8c\u53ca\u4f18\u8d28\u670d\u52a1\u3002<\/p>\n

\u656c\u8bf7\u53c2\u4e0e\u6b64\u6b21\u8c03\u67e5\u7684\u60a8\uff0c\u5728\u671f\u672b\u9636\u6bb5\u5411\u6211\u4eec\u53cd\u9988\u5b9e\u9645\u64cd\u4f5c\u8fc7\u7a0b\u4e2d\u9047\u5230\u8fc7\u54ea\u4e9b\u4e0eLinux\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u6709\u5173\u7684\u56f0\u60d1\u53ca\u95ee\u9898\u89e3\u51b3\u65b9\u6cd5\u3002\u5bf9\u4e8e\u9ad8\u6548\u7684Linux\u73af\u5883\u53d8\u91cf\u7ba1\u7406\u7b56\u7565\uff0c\u60a8\u53c8\u662f\u5426\u80fd\u63d0\u4f9b\u72ec\u5230\u7684\u89c1\u89e3\u6216\u4e30\u5bcc\u7684\u5b9e\u8df5\u7ecf\u9a8c\u4f9b\u5927\u5bb6\u5171\u4eab\u5462\uff1f\u671f\u5f85\u60a8\u7684\u70ed\u70c8\u56de\u5e94\u4ee5\u53ca\u6df1\u5ea6\u8ba8\u8bba\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u5728Linux\u7cfb\u7edf\u4e2d\uff0c\u73af\u5883\u53d8\u91cf\u8d1f\u8d23\u8bbe\u7f6e\u57fa\u7840\u8fd0\u884c\u53c2\u6570\u7684\u5173\u952e\u529f\u80fd\uff0c\u5b9e\u8df5\u8fd0\u7528\u65f6\uff0c\u987b\u4f9d\u636e\u4e0d\u540c\u9700\u6c42\u800c\u5bf9\u5176\u5b9e\u65bd\u5fc5\u8981\u7684\u8c03\u6574\uff0c\u4ee5\u9002\u5e94\u5404\u7c7b\u7279\u6b8a\u9700\u8981\u53ca\u5e94\u7528\u573a\u666f\u3002\u5bf9\u73af\u5883\u53d8\u91cf\u7684\u8bbe\u7f6e\u4e0e\u8c03\u6574\u9700\u8981\u6df1\u5165\u7406\u89e3\u5176\u5b9a\u4e49\u53ca\u5176\u529f\u80fd\u3002\u6df1\u5165\u4e86\u89e3\u53ca\u7075\u6d3b\u8fd0\u7528\u6b64\u7c7b\u73af\u5883\u53d8\u91cf\uff0c\u5bf9\u4e8e\u7cfb\u7edf\u7ba1\u7406\u53ca\u8f6f\u4ef6\u5f00\u53d1\u5177\u6709\u91cd\u8981\u610f\u4e49\u3002<\/p>\n","protected":false},"author":1,"featured_media":291228,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-291227","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\/291227","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=291227"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/291227\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/291228"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=291227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=291227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=291227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}