{"id":262876,"date":"2023-01-28T22:07:13","date_gmt":"2023-01-28T14:07:13","guid":{"rendered":"https:\/\/lrxjmw.cn\/lhjblwjhxgnj.html"},"modified":"2023-01-28T22:07:13","modified_gmt":"2023-01-28T14:07:13","slug":"lhjblwjhxgnj","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lhjblwjhxgnj.html","title":{"rendered":"Linux\u73af\u5883\u53d8\u91cf\u6587\u4ef6\u6838\u5fc3\u529f\u80fd\u5c31\u662f\u5b58\u50a8(etc)"},"content":{"rendered":"

linux\u73af\u5883\u53d8\u91cf\u6587\u4ef6<\/strong>\u662f\u4e00\u79cd\u5728Linux<\/a>\u64cd\u4f5c\u7cfb\u7edf<\/a>\u4e2d\u7528\u6765\u5b58\u50a8\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u7684\u6587\u4ef6\uff0c\u5b83\u662f\u64cd\u4f5c\u7cfb\u7edf\u7684\u4e00\u90e8\u5206\uff0c\u7528\u4e8e\u914d\u7f6e\u64cd\u4f5c\u7cfb\u7edf\u7684\u8fd0\u884c\u53c2\u6570\uff0c\u4f7f\u5f97\u64cd\u4f5c\u7cfb\u7edf\u80fd\u591f\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n

\u4e00\u822c\u6765\u8bf4\uff0cLinux\u64cd\u4f5c\u7cfb\u7edf\u7684\u5404\u4e2a\u7248\u672c\u7684\u73af\u5883\u53d8\u91cf\u6587\u4ef6\u90fd\u6709\u4e00\u5b9a\u7684\u4e0d\u540c\uff0c\u4f46\u5176\u6838\u5fc3\u529f\u80fd\u90fd\u662f\u76f8\u540c\u7684\u3002Linux \u73af\u5883\u53d8\u91cf\u6587\u4ef6\u4e3b\u8981\u7531\u4e09\u4e2a\u6587\u4ef6\uff1a\/etc\/profile\u3001\/etc\/bashrc \u548c~\/.bash_profile \u7ec4\u6210\u3002\u5176\u4e2d\uff0c\/etc\/profile \u6587\u4ef6\u662f\u6240\u6709\u7528\u6237\u5171\u4eab\u7684\u914d\u7f6e\u6587\u4ef6\uff1b\/etc\/bashrc \u6587\u4ef6\u662f bash shell<\/a> \u7684\u521d\u59cb\u5316\u914d\u7f6e\u6587\u4ef6\uff1b~\/.bash_profile \u6587\u4ef6\u662f\u6bcf\u4e2a\u7528\u6237\u81ea\u5df1\u72ec\u7acb\u4f7f\u7528\u7684\u914d\u7f6e\u6587\u4ef6\u3002<\/p>\n

linux\u73af\u5883\u53d8\u91cf\u6587\u4ef6_linux \u547d\u4ee4\u91cc\u652f\u6301\u53d8\u91cf\u5417_\u73af\u5883\u7ba1\u7406\u673a\u6784\u51fa\u53f0\u6587\u4ef6\u6587\u4ef6<\/p>\n

\/etc\/profile \u6587\u4ef6\u662f\u6240\u6709 Linux \u7528\u6237\u5171\u4eab\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5b83\u5728\u7528\u6237\u6bcf\u6b21\u542f\u52a8 Linux \u7cfb\u7edf\u65f6\u88ab\u8bfb\u53d6\u5e76\u6267\u884c\u3002\u5728\/etc\/profile \u4e2d\u5b9a\u4e49\u7684\u5185\u5bb9\u4f1a\u5e94\u7528\u5230\u6240\u6709\u7528\u6237\u8d26\u53f7\u4e0alinux\u73af\u5883\u53d8\u91cf\u6587\u4ef6<\/strong>linux\u73af\u5883\u53d8\u91cf\u6587\u4ef6<\/strong>\uff0c\u56e0\u6b64\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u5b9a\u4e49\u7684\u5185\u5bb9\u901a\u5e38\u90fd\u662f\u4e00\u4e9b\u516c\u5171\u6027\u7684\u4fe1\u606f\uff0c\u5982PATH\u3001HOSTNAME\u3001MAIL\u3001SHELL\u3001UMASK \u7b49\u516c\u5171\u6027\u53d8\u91cf\u548c\u547d\u4ee4<\/a>\u3002<\/p>\n

\/etc\/bashrc \u6587\u4ef6\u662f bash shell \u521d\u59cb\u5316\u914d\u7f6e\u6587\u4ef6\uff0c\u5b83\u5728 bash shell \u6bcf\u6b21\u542f\u52a8\u65f6\u90fd\u4f1a\u88ab\u8bfb\u53d6\u5e76\u6267\u884c\u3002\u5b83\u4e0e\/etc\/profile \u6709\u6240\u4e0d\u540c\u7ea2\u5e3dlinux\u7cfb\u7edf\u4e0b\u8f7d\uff0c\u56e0\u4e3a\/etc\/bashrc \u5728 bash shell \u542f\u52a8\u65f6\u6c38\u8fdc\u90fd\u4f1a\u88ab\u8bfb\u53d6\u5e76\u6267\u884c\uff1b\u800c\/etc\/profile \u662f\u5728\u7528\u6237\u6bcf\u6b21\u542f\u52a8 Linux \u7cfb\u7edf\u65f6\u624d\u4f1a\u88ab\u8bfb\u53d6\u5e76\u6267\u884c\u3002\u56e0\u6b64\uff0c\u5728\/etc\/bashrc \u4e2d\u5b9a\u4e49\u7684\u5185\u5bb9\u4f1a\u9488\u5bf9 bash shell \u8fd9\u4e00\u7279\u5b9a\u7684\u5e94\u7528\u751f\u6548\uff1b\u800c\u5728\/etc\/profile \u4e2d\u5b9a\u4e49\u7684\u5185\u5bb9\u5219\u4f1a\u9488\u5bf9\u6574\u4e2a Linux \u7cfb\u7edf\u751f\u6548\u3002<\/p>\n

linux \u547d\u4ee4\u91cc\u652f\u6301\u53d8\u91cf\u5417_linux\u73af\u5883\u53d8\u91cf\u6587\u4ef6_\u73af\u5883\u7ba1\u7406\u673a\u6784\u51fa\u53f0\u6587\u4ef6\u6587\u4ef6<\/p>\n

~\/.bash_profile \u6587\u4ef6\u662f\u6bcf\u4e2a Linux \u7528\u6237\u8d26\u53f7\u72ec\u7acb\u4f7f\u7528\u7684\u914d\u7f6e\u6587\u4ef6\u3002\u5728~\/.bash_profile \u4e2d\u53ef\u4ee5\u9488\u5bf9\u7279\u5b9a\u7528\u6237\u8d26\u53f7\u8fdb\u884c\u4e2a\u6027\u5316\u8bbe\u5b9a\uff1b\u4f8b\u5982\u53ef\u4ee5\u6839\u636e\u7279\u5b9a\u7528\u6237\u8d26\u53f7\u6765\u8bbe\u5b9a\u975e\u5171\u4eab\u6027\u4fe1\u606f\u5982 HISTFILE \u548c PS1 \u53d8\u91cf\u3002<\/p>\n

Linux \u73af\u5883\u53d8\u91cf\u6587\u4ef6\u6838\u5fc3\u529f\u80fd\u5c31\u662f\u5b58\u50a8 Linux \u73af\u5883\u53d8\u91cf\u4fe1\u606f\uff1b\u800c\u901a\u8fc7\u4fee\u6539 Linux \u73af\u5883\u53d8\u91cf\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9\u6765\u914d\u7f6e Linux \u64cd\u4f5c\u7cfb\u7edf\u8fd0\u884c\u65f6\u7684\u4e00\u4e9b\u5c5e\u6027\u548c\u884c\u4e3a\u3002\u4f8b\u5982\u901a\u8fc7\u4fee\u6539 PATH \u53d8\u91cf\u6765\u4fee\u6539 Linux \u7cfb\u7edf\u5bf9\u4e8e\u547d\u4ee4\u7684\u5904\u7406\u65b9\u5f0f\u3001\u901a\u8fc7\u4fee\u6539 HISTFILESIZE \u548c HISTTIMEFORMAT \u53d8\u91cf\u6765\u4fee\u6539\u5386\u53f2\u547d\u4ee4\u5b58\u50a8\u65b9\u5f0f\u3001\u901a\u8fc7\u4fee\u6539 PROMPT_COMMAND \u548c PS1 \u53d8\u91cf\u6765\u4fee\u6539 bash shell \u95ee\u5019\u8bed\u663e\u793a\u65b9\u5f0f\u3001\u901a\u8fc7\u4fee\u6539 EDITOR \u548c VISUAL \u53d8\u91cf\u6765\u914d shell \u4f7f\u7528\u4f55\u79cd\u6587\u672c\u5904\u7406\u5de5\u5177\u6765\u5904\u7406\u811a\u672c\u548c\u547d\u4ee4\u884c\u8f93\u51fa\u5185\u5bb9\u3002<\/p>\n

linux\u73af\u5883\u53d8\u91cf\u6587\u4ef6_\u73af\u5883\u7ba1\u7406\u673a\u6784\u51fa\u53f0\u6587\u4ef6\u6587\u4ef6_linux \u547d\u4ee4\u91cc\u652f\u6301\u53d8\u91cf\u5417<\/p>\n

\u6b64\u5916linux\u8fd0\u7ef4\u62db\u8058\uff0cLinux \u73af\u5883\u53d8\u91cf\u6587\u4ef6\u66f4\u5e38\u51fa\u4e8e\u4e00\u4e9b\u7279\u522b\u76ee\u7684\u800c\u88ab\u4f7f\u7528\uff1b\u4f8b\u5982\u4f7f\u7528 export -p\u547d\u4ee4\u5c06\u5f53\u524dshell session \u4e2d\u5df2\u5b58\u5728\u7684 enviroment variable \u8f93\u51fa\u5230\u4e00\u4e2a\u7279\u522b\u76ee\u5f55\u4e2d\u53bb\u4f9b\u5176\u4ed6shell session \u8c03\u7528\u4e4b\u7528\u3002<\/p>\n

\u603b\u4e4b\uff0cLinux \u73af\u5883\u53d8\u91cf\u6587\u4ef6\u62e5\u6709\u5f88\u5f3a\u5927\u7684\u529f\u80fd\uff1b\u7136\u800c\u8981\u60f3\u6b63\u5e38\u4f7f\u7528 Linux \u73af\u5883\u53d8\u91cf\u6587\u4ef6\u66f4\u8981\u6cd5\u6cd5\u5148\u5929\u3001\u5957\u7262\u6838\u5fc3\u539f\u7406\u4e4b\u4e0a\u3002\u56e0\u6b64\u5bf9\u4e8e\u60f3\u8981\u5b66\u4e60 Linux \u7cfb\u7edf\u8001\u5e08\u6765\u8bf4\u5b66\u4e60 linux \u73af\u5883\u53d8\u91cf\u6587\u4ef6\u6781\u5ea6\u5fc5\u8981\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

linux\u73af\u5883\u53d8\u91cf\u6587\u4ef6\u662f\u4e00\u79cd\u5728Linux\u64cd\u4f5c\u7cfb\u7edf\u4e2d\u7528\u6765\u5b58\u50a8\u7cfb\u7edf\u73af\u5883\u53d8\u91cf\u7684\u6587\u4ef6\uff0c\u5b83\u662f\u64cd\u4f5c\u7cfb\u7edf\u7684\u4e00\u90e8\u5206\uff0c\u7528\u4e8e\u914d\u7f6e\u64cd\u4f5c\u7cfb\u7edf\u7684\u8fd0\u884c\u53c2\u6570\uff0c\u4f7f\u5f97\u64cd\u4f5c\u7cfb\u7edf\u80fd\u591f\u6b63\u5e38\u8fd0\u884c\u3002\u4e00\u822c\u6765\u8bf4\uff0cLinux\u64cd\u4f5c\u7cfb\u7edf\u7684\u5404\u4e2a\u7248\u672c\u7684\u73af\u5883\u53d8\u91cf\u6587\u4ef6\u90fd\u6709\u4e00\u5b9a\u7684\u4e0d\u540c\uff0c\u4f46\u5176\u6838\u5fc3\u529f\u80fd\u90fd\u662f\u76f8\u540c\u7684\u3002\u7684\u521d\u59cb\u5316\u914d\u7f6e\u6587\u4ef6\uff1b~\u6587\u4ef6\u662f\u6bcf\u4e2a\u7528\u6237\u81ea\u5df1\u72ec\u7acb\u4f7f\u7528\u7684\u914d\u7f6e\u6587\u4ef6\u3002\u7528\u6237\u8d26\u53f7\u72ec\u7acb\u4f7f\u7528\u7684\u914d\u7f6e\u6587\u4ef6\u3002\u73af\u5883\u53d8\u91cf\u6587\u4ef6\u66f4\u8981\u6cd5\u6cd5\u5148\u5929\u3001\u5957\u7262\u6838\u5fc3\u539f\u7406\u4e4b\u4e0a\u3002\u73af\u5883\u53d8\u91cf\u6587\u4ef6\u6781\u5ea6\u5fc5\u8981\u3002<\/p>\n","protected":false},"author":1,"featured_media":262877,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-262876","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\/262876","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=262876"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/262876\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/262877"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=262876"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=262876"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=262876"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}