{"id":262658,"date":"2023-01-23T14:00:41","date_gmt":"2023-01-23T06:00:41","guid":{"rendered":"https:\/\/lrxjmw.cn\/abldsczqlhfl.html"},"modified":"2023-01-23T14:00:41","modified_gmt":"2023-01-23T06:00:41","slug":"abldsczqlhfl","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/abldsczqlhfl.html","title":{"rendered":"\u6309\u53d8\u91cf\u7684\u751f\u5b58\u5468\u671f\u6765\u5212\u5206\uff0cLinux\u53d8\u91cf\u53ef\u5206\u4e3a\u4e24\u7c7b"},"content":{"rendered":"

\u6309\u53d8\u91cf<\/a>\u7684\u751f\u5b58\u5468\u671f\u6765\u5212\u5206\uff0cLinux<\/a>\u53d8\u91cf\u53ef\u5206\u4e3a\u4e24\u7c7b\uff0c\u5b83\u4eec\u7684\u4fee\u6539\u65b9\u6cd5\u5982\u4e0b:<\/p>\n

(1)\u6c38\u4e45\u7684:\u9700\u8981\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\uff0c\u53d8\u91cf\u6c38\u4e45\u751f\u6548\u3002<\/p>\n

\u5e38\u89c1\u7684\u914d\u7f6e\u6587\u4ef6\u5305\u62ec:<\/p>\n

(1-1)\/etc\/profile:\u5bf9\u6240\u6709\u7528\u6237\u751f\u6548;\u6b64\u6587\u4ef6\u4e3a\u7cfb\u7edf<\/a>\u7684\u6bcf\u4e2a\u7528\u6237\u8bbe\u7f6e\u73af\u5883\u4fe1\u606f,\u5f53\u7528\u6237\u7b2c\u4e00\u6b21\u767b\u5f55\u65f6,\u8be5\u6587\u4ef6\u88ab\u6267\u884c;\u5e76\u4ece\/etc\/profile.d\u76ee\u5f55\u7684\u914d\u7f6e\u6587\u4ef6\u4e2d\u641c\u96c6shell<\/a>\u7684\u8bbe\u7f6e<\/p>\n

\u4f8b\u5982:\u7f16\u8f91\/etc\/profile\u6587\u4ef6\uff0c\u6dfb\u52a0CLASSPATH\u53d8\u91cf<\/p>\n

# vi \/etc\/profile<\/p>\n

\u6dfb\u52a0\u4e00\u884c:<\/p>\n

export CLASSPATH=.\/JAVA_HOME\/lib;$JAVA_HOME\/jre\/lib<\/p>\n

\u4fee\u6539\u540e\u9700\u8981\u6267\u884c\u91cd\u65b0\u767b\u5f55\u624d\u80fd\u751f\u6548\uff0c\u4e5f\u53ef\u4ee5\u6267\u884c\u547d\u4ee4<\/a>source \/etc\/profile\u6765\u751f\u6548<\/p>\n

(1-2)\/etc\/bashrc:\u5bf9\u6240\u6709\u7528\u6237\u751f\u6548;\u4e3a\u6bcf\u4e00\u4e2a\u8fd0\u884cbash shell\u7684\u7528\u6237\u6267\u884c\u6b64\u6587\u4ef6.\u5f53bash shell\u88ab\u6253\u5f00\u65f6,\u8be5\u6587\u4ef6\u88ab\u8bfb\u53d6<\/p>\n

\u7f16\u8f91\u65b9\u6cd5\u5982\u4e0a\uff0c\u4e0d\u518d\u8d58\u8ff0<\/p>\n

(1-3)~\/.bash_profile:\u4ec5\u4f1a\u5bf9\u5f53\u524d\u7528\u6237\u6709\u6548;\u6bcf\u4e2a\u7528\u6237\u90fd\u53ef\u4f7f\u7528\u8be5\u6587\u4ef6\u8f93\u5165\u4e13\u7528\u4e8e\u81ea\u5df1\u4f7f\u7528\u7684shell\u4fe1\u606f,\u5f53\u7528\u6237\u767b\u5f55\u65f6,\u8be5\u6587\u4ef6\u4ec5\u4ec5\u6267\u884c\u4e00\u6b21<\/p>\n

\u4f8b\u5982:\u7f16\u8f91guok\u7528\u6237\u76ee\u5f55(\/home\/guok)\u4e0b\u7684.bash_profile<\/p>\n

$ vi \/home\/guok\/.bash.profile<\/p>\n

linux etc\u7528\u6237\u73af\u5883_linux\u4fee\u6539\u6587\u4ef6\u6240\u5c5e\u7528\u6237_linux\u4fee\u6539\u7528\u6237\u73af\u5883\u53d8\u91cf<\/p>\n

\u6dfb\u52a0\u5982\u4e0b\u5185\u5bb9:<\/p>\n

export CLASSPATH=.\/JAVA_HOME\/lib;$JAVA_HOME\/jre\/lib<\/p>\n

\u4fee\u6539\u540e\u9700\u8981\u6267\u884c\u91cd\u65b0\u767b\u5f55\u624d\u80fd\u751f\u6548\uff0c\u4e5f\u53ef\u4ee5\u6267\u884c\u547d\u4ee4source \/etc\/profile\u6765\u751f\u6548<\/p>\n

(1-4)~\/.bashrc:\u4ec5\u4f1a\u5bf9\u5f53\u524d\u7528\u6237\u6709\u6548;\u8be5\u6587\u4ef6\u5305\u542b\u4e13\u7528\u4e8e\u4f60\u7684bash shell\u7684bash\u4fe1\u606f,\u5f53\u767b\u5f55\u65f6\u4ee5\u53ca\u6bcf\u6b21\u6253\u5f00\u65b0\u7684shell\u65f6,\u8be5\u8be5\u6587\u4ef6\u88ab\u8bfb\u53d6<\/p>\n

\u7f16\u8f91\u65b9\u6cd5\u5982\u4e0a\uff0c\u4e0d\u518d\u8d58\u8ff0<\/p>\n

\u53e6\u5916RAR FOR LINUX\uff0c~\/.bashrc\u7b49\u4e2d\u8bbe\u5b9a\u7684\u53d8\u91cf(\u5c40\u90e8)\u53ea\u80fd\u7ee7\u627f\/etc\/profile\u4e2d\u7684\u53d8\u91cf,\u4ed6\u4eec\u662f\"\u7236\u5b50\"\u5173\u7cfb<\/p>\n

\u7efc\u8ff0\uff0c\u5bf9\u4e0a\u8ff0\u6587\u4ef6\u4fee\u6539linux\u4fee\u6539\u7528\u6237\u73af\u5883\u53d8\u91cf<\/strong>\uff0c\u6dfb\u52a0\u4f60\u9700\u8981\u7684\u53d8\u91cf\uff0c\u5728\u542f\u52a8\u4e00\u4e2ashell(\u7ec8\u7aef\uff0cterminal)\u65f6\uff0c\u4f60\u6240\u5b9a\u4e49\u7684\u53d8\u91cf\u5747\u4f1a\u751f\u6548\u7684\u3002<\/p>\n

(2)\u4e34\u65f6\u7684:\u4f7f\u7528export\u547d\u4ee4\u58f0\u660e\u5373\u53ef\uff0c\u53d8\u91cf\u53ea\u5728\u5f53\u524d\u7684shell(BASH)\u6216\u5176\u5b50shell(BASH)\u4e0b\u662f\u6709\u6548\u7684,\u5728\u5173\u95edshell\u540e\u5931\u6548\uff0c\u518d\u6253\u5f00\u65b0shell\u65f6\u5c31\u6ca1\u6709\u8fd9\u4e2a\u53d8\u91cf\uff0c\u9700\u8981\u4f7f\u7528\u7684\u8bdd\u8fd8\u9700\u8981\u91cd\u65b0\u5b9a\u4e49<\/p>\n

\u5728shell\u7684\u547d\u4ee4\u884c\u4e0b\u76f4\u63a5\u4f7f\u7528[export \u53d8\u91cf\u540d=\u53d8\u91cf\u503c] \u5b9a\u4e49\u53d8\u91cf<\/p>\n

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

(1)\u4f7f\u7528echo\u547d\u4ee4\u67e5\u770b\u5355\u4e2a\u73af\u5883\u53d8\u91cf\u3002\u4f8b\u5982:<\/p>\n

echo $PATH<\/p>\n

linux\u4fee\u6539\u6587\u4ef6\u6240\u5c5e\u7528\u6237_linux\u4fee\u6539\u7528\u6237\u73af\u5883\u53d8\u91cf_linux etc\u7528\u6237\u73af\u5883<\/p>\n

(2)\u4f7f\u7528env\u67e5\u770b\u6240\u6709\u73af\u5883\u53d8\u91cf\u3002\u4f8b\u5982:<\/p>\n

env<\/p>\n

(3)\u4f7f\u7528set\u67e5\u770b\u6240\u6709\u672c\u5730\u5b9a\u4e49\u7684\u73af\u5883\u53d8\u91cf\u3002\u4f8b\u5982:<\/p>\n

set<\/p>\n

\u53e6\u5916\uff0cunset\u53ef\u4ee5\u5220\u9664\u6307\u5b9a\u7684\u73af\u5883\u53d8\u91cf\u3002<\/p>\n

\u5e38\u7528\u7684\u73af\u5883\u53d8\u91cf<\/p>\n

linux\u4fee\u6539\u6587\u4ef6\u6240\u5c5e\u7528\u6237_linux\u4fee\u6539\u7528\u6237\u73af\u5883\u53d8\u91cf_linux etc\u7528\u6237\u73af\u5883<\/p>\n

PATH \u51b3\u5b9a\u4e86shell\u5c06\u5230\u54ea\u4e9b\u76ee\u5f55\u4e2d\u5bfb\u627e\u547d\u4ee4\u6216\u7a0b\u5e8f<\/p>\n

HOME \u5f53\u524d\u7528\u6237\u4e3b\u76ee\u5f55<\/p>\n

HISTSIZE \u5386\u53f2\u8bb0\u5f55\u6570<\/p>\n

LOGNAME \u5f53\u524d\u7528\u6237\u7684\u767b\u5f55\u540d<\/p>\n

HOSTNAME \u6307\u4e3b\u673a\u7684\u540d\u79f0<\/p>\n

SHELL \u5f53\u524d\u7528\u6237Shell\u7c7b\u578b<\/p>\n

LANGUGE \u8bed\u8a00\u76f8\u5173\u7684\u73af\u5883\u53d8\u91cf\uff0c\u591a\u8bed\u8a00\u53ef\u4ee5\u4fee\u6539\u6b64\u73af\u5883\u53d8\u91cf<\/p>\n

MAIL \u5f53\u524d\u7528\u6237\u7684\u90ae\u4ef6\u5b58\u653e\u76ee\u5f55<\/p>\n

PS1 \u57fa\u672c\u63d0\u793a\u7b26\uff0c\u5bf9\u4e8eroot\u7528\u6237\u662f#linux\u4fee\u6539\u7528\u6237\u73af\u5883\u53d8\u91cf<\/strong>\u7ea2\u8054linux\u8bba\u575b\uff0c\u5bf9\u4e8e\u666e\u901a\u7528\u6237\u662f$<\/p>\n","protected":false},"excerpt":{"rendered":"

(1)\u6c38\u4e45\u7684:\u9700\u8981\u4fee\u6539\u914d\u7f6e\u6587\u4ef6\uff0c\u53d8\u91cf\u6c38\u4e45\u751f\u6548\u3002\u7efc\u8ff0\uff0c\u5bf9\u4e0a\u8ff0\u6587\u4ef6\u4fee\u6539\uff0c\u6dfb\u52a0\u4f60\u9700\u8981\u7684\u53d8\u91cf\uff0c\u5728\u542f\u52a8\u4e00\u4e2ashell(\u7ec8\u7aef\uff0cterminal)\u65f6\uff0c\u4f60\u6240\u5b9a\u4e49\u7684\u53d8\u91cf\u5747\u4f1a\u751f\u6548\u7684\u3002(1)\u4f7f\u7528echo\u547d\u4ee4\u67e5\u770b\u5355\u4e2a\u73af\u5883\u53d8\u91cf\u3002(2)\u4f7f\u7528env\u67e5\u770b\u6240\u6709\u73af\u5883\u53d8\u91cf\u3002(3)\u4f7f\u7528set\u67e5\u770b\u6240\u6709\u672c\u5730\u5b9a\u4e49\u7684\u73af\u5883\u53d8\u91cf\u3002\u8bed\u8a00\u76f8\u5173\u7684\u73af\u5883\u53d8\u91cf\uff0c\u591a\u8bed\u8a00\u53ef\u4ee5\u4fee\u6539\u6b64\u73af\u5883\u53d8\u91cf<\/p>\n","protected":false},"author":1,"featured_media":262659,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-262658","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\/262658","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=262658"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/262658\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/262659"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=262658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=262658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=262658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}