{"id":174938,"date":"2020-04-03T08:17:25","date_gmt":"2020-04-03T00:17:25","guid":{"rendered":"https:\/\/lrxjmw.cn\/?p=174938"},"modified":"2020-03-23T09:08:04","modified_gmt":"2020-03-23T01:08:04","slug":"environment-variable-configuration","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/environment-variable-configuration.html","title":{"rendered":"Linux\u73af\u5883\u53d8\u91cf\u914d\u7f6e"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u8fd9\u7bc7\u6587\u7ae0\u4e3b\u8981\u4ecb\u7ecd\u4e86Linux\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u5168\u653b\u7565\uff0c\u6587\u4e2d\u901a\u8fc7\u793a\u4f8b\u4ee3\u7801\u4ecb\u7ecd\u7684\u975e\u5e38\u8be6\u7ec6\uff0c\u5bf9\u5927\u5bb6\u7684\u5b66\u4e60\u6216\u8005\u5de5\u4f5c\u5177\u6709\u4e00\u5b9a\u7684\u53c2\u8003\u5b66\u4e60\u4ef7\u503c\uff0c\u9700\u8981\u7684\u670b\u53cb\u4eec\u4e0b\u9762\u968f\u7740\u5c0f\u7f16\u6765\u4e00\u8d77\u5b66\u4e60\u5b66\u4e60\u5427\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\u5728\u81ea\u5b9a\u4e49\u5b89\u88c5\u8f6f\u4ef6\u7684\u65f6\u5019\uff0c\u7ecf\u5e38\u9700\u8981\u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u4e0b\u9762\u5217\u4e3e\u51fa\u5404\u79cd\u5bf9\u73af\u5883\u53d8\u91cf\u7684\u914d\u7f6e\u65b9\u6cd5\u3002<\/p>\n

\u4e0b\u9762\u6240\u6709\u4f8b\u5b50\u7684\u73af\u5883\u8bf4\u660e\u5982\u4e0b\uff1a<\/p>\n

\r\n\u7cfb\u7edf\uff1aUbuntu 14.0\r\n\u7528\u6237\u540d\uff1auusama\r\n\u9700\u8981\u914d\u7f6eMySQL\u73af\u5883\u53d8\u91cf\u8def\u5f84\uff1a\/home\/uusama\/mysql\/bin\r\n<\/pre>\n
Linux\u8bfb\u53d6\u73af\u5883\u53d8\u91cf\u7684\u65b9\u6cd5\uff1a<\/strong><\/div>\n
\r\nexport\u547d\u4ee4\u663e\u793a\u5f53\u524d\u7cfb\u7edf\u5b9a\u4e49\u7684\u6240\u6709\u73af\u5883\u53d8\u91cf\r\necho $PATH\u547d\u4ee4\u8f93\u51fa\u5f53\u524d\u7684PATH\u73af\u5883\u53d8\u91cf\u7684\u503c\r\n\u8fd9\u4e24\u4e2a\u547d\u4ee4\u6267\u884c\u7684\u6548\u679c\u5982\u4e0b\r\n\r\nuusama@ubuntu:~$ export\r\ndeclare -x HOME=\"\/home\/uusama\"\r\ndeclare -x LANG=\"en_US.UTF-8\"\r\ndeclare -x LANGUAGE=\"en_US:\"\r\ndeclare -x LESSCLOSE=\"\/usr\/bin\/lesspipe %s %s\"\r\ndeclare -x LESSOPEN=\"| \/usr\/bin\/lesspipe %s\"\r\ndeclare -x LOGNAME=\"uusama\"\r\ndeclare -x MAIL=\"\/var\/mail\/uusama\"\r\ndeclare -x PATH=\"\/home\/uusama\/bin:\/home\/uusama\/.local\/bin:\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin\"\r\ndeclare -x SSH_TTY=\"\/dev\/pts\/0\"\r\ndeclare -x TERM=\"xterm\"\r\ndeclare -x USER=\"uusama\"\r\n \r\nuusama@ubuntu:~$ echo $PATH\r\n\/home\/uusama\/bin:\/home\/uusama\/.local\/bin:\/usr\/local\/sbin:\/usr\/local\/bin:\/usr\/sbin:\/usr\/bin:\/sbin:\/bin\r\n\u5176\u4e2dPATH\u53d8\u91cf\u5b9a\u4e49\u4e86\u8fd0\u884c\u547d\u4ee4\u7684\u67e5\u627e\u8def\u5f84\uff0c\u4ee5\u5192\u53f7:\u5206\u5272\u4e0d\u540c\u7684\u8def\u5f84\uff0c\u4f7f\u7528export\u5b9a\u4e49\u7684\u65f6\u5019\u53ef\u52a0\u53cc\u5f15\u53f7\u4e5f\u53ef\u4e0d\u52a0\u3002\r\n<\/pre>\n
Linux\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u65b9\u6cd5\u4e00\uff1aexport PATH<\/strong><\/div>\n
\r\n\u4f7f\u7528export\u547d\u4ee4\u76f4\u63a5\u4fee\u6539PATH\u7684\u503c\uff0c\u914d\u7f6eMySQL\u8fdb\u5165\u73af\u5883\u53d8\u91cf\u7684\u65b9\u6cd5:\r\n\r\nexport PATH=\/home\/uusama\/mysql\/bin:$PATH\r\n \r\n# \u6216\u8005\u628aPATH\u653e\u5728\u524d\u9762\r\nexport PATH=$PATH:\/home\/uusama\/mysql\/bin\r\n<\/pre>\n
\u6ce8\u610f\u4e8b\u9879\uff1a<\/strong><\/span><\/div>\n
\r\n\u751f\u6548\u65f6\u95f4\uff1a\u7acb\u5373\u751f\u6548\r\n\u751f\u6548\u671f\u9650\uff1a\u5f53\u524d\u7ec8\u7aef\u6709\u6548\uff0c\u7a97\u53e3\u5173\u95ed\u540e\u65e0\u6548\r\n\u751f\u6548\u8303\u56f4\uff1a\u4ec5\u5bf9\u5f53\u524d\u7528\u6237\u6709\u6548\r\n\u914d\u7f6e\u7684\u73af\u5883\u53d8\u91cf\u4e2d\u4e0d\u8981\u5fd8\u4e86\u52a0\u4e0a\u539f\u6765\u7684\u914d\u7f6e\uff0c\u5373$PATH\u90e8\u5206\uff0c\u907f\u514d\u8986\u76d6\u539f\u6765\u914d\u7f6e\r\nLinux\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u65b9\u6cd5\u4e8c\uff1avim ~\/.bashrc\r\n\u901a\u8fc7\u4fee\u6539\u7528\u6237\u76ee\u5f55\u4e0b\u7684~\/.bashrc\u6587\u4ef6\u8fdb\u884c\u914d\u7f6e\uff1a\r\n\r\nvim ~\/.bashrc\r\n \r\n# \u5728\u6700\u540e\u4e00\u884c\u52a0\u4e0a\r\nexport PATH=$PATH:\/home\/uusama\/mysql\/bin\r\n<\/pre>\n
\u6ce8\u610f\u4e8b\u9879\uff1a<\/strong><\/span><\/div>\n
\r\n\u751f\u6548\u65f6\u95f4\uff1a\u4f7f\u7528\u76f8\u540c\u7684\u7528\u6237\u6253\u5f00\u65b0\u7684\u7ec8\u7aef\u65f6\u751f\u6548\uff0c\u6216\u8005\u624b\u52a8source ~\/.bashrc\u751f\u6548\r\n\u751f\u6548\u671f\u9650\uff1a\u6c38\u4e45\u6709\u6548\r\n\u751f\u6548\u8303\u56f4\uff1a\u4ec5\u5bf9\u5f53\u524d\u7528\u6237\u6709\u6548\r\n\u5982\u679c\u6709\u540e\u7eed\u7684\u73af\u5883\u53d8\u91cf\u52a0\u8f7d\u6587\u4ef6\u8986\u76d6\u4e86PATH\u5b9a\u4e49\uff0c\u5219\u53ef\u80fd\u4e0d\u751f\u6548\r\nLinux\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u65b9\u6cd5\u4e09\uff1avim ~\/.bash_profile\r\n\u548c\u4fee\u6539~\/.bashrc\u6587\u4ef6\u7c7b\u4f3c\uff0c\u4e5f\u662f\u8981\u5728\u6587\u4ef6\u6700\u540e\u52a0\u4e0a\u65b0\u7684\u8def\u5f84\u5373\u53ef\uff1a\r\n\r\nvim ~\/.bash_profile\r\n \r\n# \u5728\u6700\u540e\u4e00\u884c\u52a0\u4e0a\r\nexport PATH=$PATH:\/home\/uusama\/mysql\/bin\r\n<\/pre>\n
\u6ce8\u610f\u4e8b\u9879\uff1a<\/strong><\/span><\/div>\n
\r\n\u751f\u6548\u65f6\u95f4\uff1a\u4f7f\u7528\u76f8\u540c\u7684\u7528\u6237\u6253\u5f00\u65b0\u7684\u7ec8\u7aef\u65f6\u751f\u6548\uff0c\u6216\u8005\u624b\u52a8source ~\/.bash_profile\u751f\u6548\r\n\u751f\u6548\u671f\u9650\uff1a\u6c38\u4e45\u6709\u6548\r\n\u751f\u6548\u8303\u56f4\uff1a\u4ec5\u5bf9\u5f53\u524d\u7528\u6237\u6709\u6548\r\n\u5982\u679c\u6ca1\u6709~\/.bash_profile\u6587\u4ef6\uff0c\u5219\u53ef\u4ee5\u7f16\u8f91~\/.profile\u6587\u4ef6\u6216\u8005\u65b0\u5efa\u4e00\u4e2a\r\nLinux\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u65b9\u6cd5\u56db\uff1avim \/etc\/bashrc\r\n\u8be5\u65b9\u6cd5\u662f\u4fee\u6539\u7cfb\u7edf\u914d\u7f6e\uff0c\u9700\u8981\u7ba1\u7406\u5458\u6743\u9650\uff08\u5982root\uff09\u6216\u8005\u5bf9\u8be5\u6587\u4ef6\u7684\u5199\u5165\u6743\u9650\uff1a\r\n\r\n# \u5982\u679c\/etc\/bashrc\u6587\u4ef6\u4e0d\u53ef\u7f16\u8f91\uff0c\u9700\u8981\u4fee\u6539\u4e3a\u53ef\u7f16\u8f91\r\nchmod -v u+w \/etc\/bashrc\r\n \r\nvim \/etc\/bashrc\r\n \r\n# \u5728\u6700\u540e\u4e00\u884c\u52a0\u4e0a\r\nexport PATH=$PATH:\/home\/uusama\/mysql\/bin\r\n<\/pre>\n
\u6ce8\u610f\u4e8b\u9879\uff1a<\/strong><\/span><\/div>\n
\r\n\u751f\u6548\u65f6\u95f4\uff1a\u65b0\u5f00\u7ec8\u7aef\u751f\u6548\uff0c\u6216\u8005\u624b\u52a8source \/etc\/bashrc\u751f\u6548\r\n\u751f\u6548\u671f\u9650\uff1a\u6c38\u4e45\u6709\u6548\r\n\u751f\u6548\u8303\u56f4\uff1a\u5bf9\u6240\u6709\u7528\u6237\u6709\u6548\r\nLinux\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u65b9\u6cd5\u4e94\uff1avim \/etc\/profile\r\n\u8be5\u65b9\u6cd5\u4fee\u6539\u7cfb\u7edf\u914d\u7f6e\uff0c\u9700\u8981\u7ba1\u7406\u5458\u6743\u9650\u6216\u8005\u5bf9\u8be5\u6587\u4ef6\u7684\u5199\u5165\u6743\u9650\uff0c\u548cvim \/etc\/bashrc\u7c7b\u4f3c\uff1a\r\n\r\n# \u5982\u679c\/etc\/profile\u6587\u4ef6\u4e0d\u53ef\u7f16\u8f91\uff0c\u9700\u8981\u4fee\u6539\u4e3a\u53ef\u7f16\u8f91\r\nchmod -v u+w \/etc\/profile\r\n \r\nvim \/etc\/profile\r\n \r\n# \u5728\u6700\u540e\u4e00\u884c\u52a0\u4e0a\r\nexport PATH=$PATH:\/home\/uusama\/mysql\/bin\r\n<\/pre>\n
\u6ce8\u610f\u4e8b\u9879\uff1a<\/strong><\/span><\/div>\n
\r\n\u751f\u6548\u65f6\u95f4\uff1a\u65b0\u5f00\u7ec8\u7aef\u751f\u6548\uff0c\u6216\u8005\u624b\u52a8source \/etc\/profile\u751f\u6548\r\n\u751f\u6548\u671f\u9650\uff1a\u6c38\u4e45\u6709\u6548\r\n\u751f\u6548\u8303\u56f4\uff1a\u5bf9\u6240\u6709\u7528\u6237\u6709\u6548\r\nLinux\u73af\u5883\u53d8\u91cf\u914d\u7f6e\u65b9\u6cd5\u516d\uff1avim \/etc\/environment\r\n\u8be5\u65b9\u6cd5\u662f\u4fee\u6539\u7cfb\u7edf\u73af\u5883\u914d\u7f6e\u6587\u4ef6\uff0c\u9700\u8981\u7ba1\u7406\u5458\u6743\u9650\u6216\u8005\u5bf9\u8be5\u6587\u4ef6\u7684\u5199\u5165\u6743\u9650\uff1a\r\n\r\n# \u5982\u679c\/etc\/bashrc\u6587\u4ef6\u4e0d\u53ef\u7f16\u8f91\uff0c\u9700\u8981\u4fee\u6539\u4e3a\u53ef\u7f16\u8f91\r\nchmod -v u+w \/etc\/environment\r\n \r\nvim \/etc\/profile\r\n \r\n# \u5728\u6700\u540e\u4e00\u884c\u52a0\u4e0a\r\nexport PATH=$PATH:\/home\/uusama\/mysql\/bin\r\n<\/pre>\n
\u6ce8\u610f\u4e8b\u9879\uff1a<\/strong><\/span><\/div>\n
\r\n\u751f\u6548\u65f6\u95f4\uff1a\u65b0\u5f00\u7ec8\u7aef\u751f\u6548\uff0c\u6216\u8005\u624b\u52a8source \/etc\/environment\u751f\u6548\r\n\u751f\u6548\u671f\u9650\uff1a\u6c38\u4e45\u6709\u6548\r\n\u751f\u6548\u8303\u56f4\uff1a\u5bf9\u6240\u6709\u7528\u6237\u6709\u6548\r\nLinux\u73af\u5883\u53d8\u91cf\u52a0\u8f7d\u539f\u7406\u89e3\u6790\r\n\u4e0a\u9762\u5217\u51fa\u4e86\u73af\u5883\u53d8\u91cf\u7684\u5404\u79cd\u914d\u7f6e\u65b9\u6cd5\uff0c\u90a3\u4e48Linux\u662f\u5982\u4f55\u52a0\u8f7d\u8fd9\u4e9b\u914d\u7f6e\u7684\u5462\uff1f\u662f\u4ee5\u4ec0\u4e48\u6837\u7684\u987a\u5e8f\u52a0\u8f7d\u7684\u5462\uff1f\r\n\r\n\u7279\u5b9a\u7684\u52a0\u8f7d\u987a\u5e8f\u4f1a\u5bfc\u81f4\u76f8\u540c\u540d\u79f0\u7684\u73af\u5883\u53d8\u91cf\u5b9a\u4e49\u88ab\u8986\u76d6\u6216\u8005\u4e0d\u751f\u6548\u3002\r\n\r\n\u73af\u5883\u53d8\u91cf\u7684\u5206\u7c7b\r\n\u73af\u5883\u53d8\u91cf\u53ef\u4ee5\u7b80\u5355\u7684\u5206\u6210\u7528\u6237\u81ea\u5b9a\u4e49\u7684\u73af\u5883\u53d8\u91cf\u4ee5\u53ca\u7cfb\u7edf\u7ea7\u522b\u7684\u73af\u5883\u53d8\u91cf\u3002\r\n\r\n\u7528\u6237\u7ea7\u522b\u73af\u5883\u53d8\u91cf\u5b9a\u4e49\u6587\u4ef6\uff1a~\/.bashrc\u3001~\/.bash_profile\r\n\u7cfb\u7edf\u7ea7\u522b\u73af\u5883\u53d8\u91cf\u5b9a\u4e49\u6587\u4ef6\uff1a\/etc\/bashrc\u3001\/etc\/bash_profile\u3001\/etc\/environment\r\n\u53e6\u5916\u5728\u7528\u6237\u73af\u5883\u53d8\u91cf\u4e2d\uff0c\u7cfb\u7edf\u4f1a\u9996\u5148\u8bfb\u53d6~\/.bash_profile\u6587\u4ef6\uff0c\u5982\u679c\u6ca1\u6709\u8be5\u6587\u4ef6\u5219\u8bfb\u53d6~\/.bash_login\uff0c\u5982\u679c\u4e5f\u6ca1\u6709\u8be5\u6587\u4ef6\uff0c\u5219\u8bfb\u53d6~\/.profile\uff0c\u6839\u636e\u8fd9\u4e9b\u6587\u4ef6\u4e2d\u5185\u5bb9\u518d\u53bb\u8bfb\u53d6~\/.bashrc\u3002\r\n<\/pre>\n
\u6d4b\u8bd5Linux\u73af\u5883\u53d8\u91cf\u52a0\u8f7d\u987a\u5e8f\u7684\u65b9\u6cd5<\/strong><\/div>\n

\u4e3a\u4e86\u6d4b\u8bd5\u5404\u4e2a\u4e0d\u540c\u6587\u4ef6\u7684\u73af\u5883\u53d8\u91cf\u52a0\u8f7d\u987a\u5e8f\uff0c\u6211\u4eec\u5728\u6bcf\u4e2a\u73af\u5883\u53d8\u91cf\u5b9a\u4e49\u6587\u4ef6\u4e2d\u7684\u7b2c\u4e00\u884c\u90fd\u5b9a\u4e49\u76f8\u540c\u7684\u73af\u5883\u53d8\u91cfUU_ORDER\uff0c\u8be5\u53d8\u91cf\u7684\u503c\u4e3a\u672c\u8eab\u7684\u503c\u8fde\u63a5\u4e0a\u5f53\u524d\u6587\u4ef6\u540d\u79f0\u3002<\/p>\n

\u9700\u8981\u4fee\u6539\u7684\u6587\u4ef6\u5982\u4e0b\uff1a<\/p>\n

\r\n\/etc\/environment\r\n\/etc\/profile\r\n\/etc\/profile.d\/test.sh\uff0c\u65b0\u5efa\u6587\u4ef6\uff0c\u6ca1\u6709\u6587\u4ef6\u5939\u53ef\u7565\u8fc7\r\n\/etc\/bashrc\uff0c\u6216\u8005\/etc\/bash.bashrc\r\n~\/.bash_profile\uff0c\u6216\u8005~\/.profile\r\n~\/.bashrc\r\n\u5728\u6bcf\u4e2a\u6587\u4ef6\u4e2d\u7684\u7b2c\u4e00\u884c\u90fd\u52a0\u4e0a\u4e0b\u9762\u8fd9\u53e5\u4ee3\u7801\uff0c\u5e76\u76f8\u5e94\u7684\u628a\u5192\u53f7\u540e\u7684\u5185\u5bb9\u4fee\u6539\u4e3a\u5f53\u524d\u6587\u4ef6\u7684\u7edd\u5bf9\u6587\u4ef6\u540d\u3002\r\n\r\nexport UU_ORDER=\"$UU_ORDER:~\/.bash_profile\"\r\n\r\n\u4fee\u6539\u5b8c\u4e4b\u540e\u4fdd\u5b58\uff0c\u65b0\u5f00\u4e00\u4e2a\u7a97\u53e3\uff0c\u7136\u540eecho $UU_ORDER\u89c2\u5bdf\u53d8\u91cf\u7684\u503c\uff1a\r\n\r\nuusama@ubuntu:~$ echo $UU_ORDER\r\n$UU_ORDER:\/etc\/environment:\/etc\/profile:\/etc\/bash.bashrc:\/etc\/profile.d\/test.sh:~\/.profile:~\/.bashrc\r\n\u53ef\u4ee5\u63a8\u6d4b\u51faLinux\u52a0\u8f7d\u73af\u5883\u53d8\u91cf\u7684\u987a\u5e8f\u5982\u4e0b\uff1a\r\n\r\n\/etc\/environment\r\n\/etc\/profile\r\n\/etc\/bash.bashrc\r\n\/etc\/profile.d\/test.sh\r\n~\/.profile\r\n~\/.bashrc\r\n<\/pre>\n
Linux\u73af\u5883\u53d8\u91cf\u6587\u4ef6\u52a0\u8f7d\u8be6\u89e3<\/strong><\/div>\n

\u7531\u4e0a\u9762\u7684\u6d4b\u8bd5\u53ef\u5bb9\u6613\u5f97\u51faLinux\u52a0\u8f7d\u73af\u5883\u53d8\u91cf\u7684\u987a\u5e8f\u5982\u4e0b\uff1a<\/p>\n

\r\n\u7cfb\u7edf\u73af\u5883\u53d8\u91cf -> \u7528\u6237\u81ea\u5b9a\u4e49\u73af\u5883\u53d8\u91cf\r\n\/etc\/environment -> \/etc\/profile -> ~\/.profile\r\n\r\n\u6253\u5f00\/etc\/profile\u6587\u4ef6\u4f60\u4f1a\u53d1\u73b0\uff0c\u8be5\u6587\u4ef6\u7684\u4ee3\u7801\u4e2d\u4f1a\u52a0\u8f7d\/etc\/bash.bashrc\u6587\u4ef6\uff0c\u7136\u540e\u68c0\u67e5\/etc\/profile.d\/\u76ee\u5f55\u4e0b\u7684.sh\u6587\u4ef6\u5e76\u52a0\u8f7d\u3002\r\n\r\n# \/etc\/profile: system-wide .profile file for the Bourne shell (sh(1))\r\n# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).\r\n \r\nif [ \"$PS1\" ]; then\r\n if [ \"$BASH\" ] && [ \"$BASH\" != \"\/bin\/sh\" ]; then\r\n  # The file bash.bashrc already sets the default PS1.\r\n  # PS1='\\h:\\w\\$ '\r\n  if [ -f \/etc\/bash.bashrc ]; then\r\n   . \/etc\/bash.bashrc\r\n  fi\r\n else\r\n  if [ \"`id -u`\" -eq 0 ]; then\r\n   PS1='# '\r\n  else\r\n   PS1='$ '\r\n  fi\r\n fi\r\nfi\r\n \r\nif [ -d \/etc\/profile.d ]; then\r\n for i in \/etc\/profile.d\/*.sh; do\r\n  if [ -r $i ]; then\r\n   . $i\r\n  fi\r\n done\r\n unset i\r\nfi\r\n\u5176\u6b21\u518d\u6253\u5f00~\/.profile\u6587\u4ef6\uff0c\u4f1a\u53d1\u73b0\u8be5\u6587\u4ef6\u4e2d\u52a0\u8f7d\u4e86~\/.bashrc\u6587\u4ef6\u3002\r\n\r\n# if running bash\r\nif [ -n \"$BASH_VERSION\" ]; then\r\n  # include .bashrc if it exists\r\n  if [ -f \"$HOME\/.bashrc\" ]; then\r\n  . \"$HOME\/.bashrc\"\r\n  fi\r\nfi\r\n \r\n# set PATH so it includes user's private bin directories\r\nPATH=\"$HOME\/bin:$HOME\/.local\/bin:$PATH\"\r\n\u4ece~\/.profile\u6587\u4ef6\u4e2d\u4ee3\u7801\u4e0d\u96be\u53d1\u73b0\uff0c\/.profile\u6587\u4ef6\u53ea\u5728\u7528\u6237\u767b\u5f55\u7684\u65f6\u5019\u8bfb\u53d6\u4e00\u6b21\uff0c\u800c\/.bashrc\u4f1a\u5728\u6bcf\u6b21\u8fd0\u884cShell\u811a\u672c\u7684\u65f6\u5019\u8bfb\u53d6\u4e00\u6b21\u3002\r\n<\/pre>\n
\u4e00\u4e9b\u5c0f\u6280\u5de7<\/strong><\/div>\n
\r\n\u53ef\u4ee5\u81ea\u5b9a\u4e49\u4e00\u4e2a\u73af\u5883\u53d8\u91cf\u6587\u4ef6\uff0c\u6bd4\u5982\u5728\u67d0\u4e2a\u9879\u76ee\u4e0b\u5b9a\u4e49uusama.profile\uff0c\u5728\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u4f7f\u7528export\u5b9a\u4e49\u4e00\u7cfb\u5217\u53d8\u91cf\uff0c\u7136\u540e\u5728~\/.profile\u6587\u4ef6\u540e\u9762\u52a0\u4e0a\uff1asourc uusama.profile\uff0c\u8fd9\u6837\u4f60\u6bcf\u6b21\u767b\u9646\u90fd\u53ef\u4ee5\u5728Shell\u811a\u672c\u4e2d\u4f7f\u7528\u81ea\u5df1\u5b9a\u4e49\u7684\u4e00\u7cfb\u5217\u53d8\u91cf\u3002\r\n\u4e5f\u53ef\u4ee5\u4f7f\u7528alias\u547d\u4ee4\u5b9a\u4e49\u4e00\u4e9b\u547d\u4ee4\u7684\u522b\u540d\uff0c\u6bd4\u5982alias rm=\"rm -i\"\uff08\u53cc\u5f15\u53f7\u5fc5\u987b\uff09\uff0c\u5e76\u628a\u8fd9\u4e2a\u4ee3\u7801\u52a0\u5165\u5230~\/.profile\u4e2d\uff0c\u8fd9\u6837\u4f60\u6bcf\u6b21\u4f7f\u7528rm\u547d\u4ee4\u7684\u65f6\u5019\uff0c\u90fd\u76f8\u5f53\u4e8e\u4f7f\u7528rm -i\u547d\u4ee4\uff0c\u975e\u5e38\u65b9\u4fbf\u3002\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"

\u5728\u81ea\u5b9a\u4e49\u5b89\u88c5\u8f6f\u4ef6\u7684\u65f6\u5019\uff0c\u7ecf\u5e38\u9700\u8981\u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u4e0b\u9762\u5217\u4e3e\u51fa\u5404\u79cd\u5bf9\u73af\u5883\u53d8\u91cf\u7684\u914d\u7f6e\u65b9\u6cd5\u3002 \u4e0b\u9762\u6240\u6709\u4f8b\u5b50\u7684\u73af\u5883\u8bf4\u660e\u5982\u4e0b […]<\/p>\n","protected":false},"author":63,"featured_media":174939,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-174938","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\/174938","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=174938"}],"version-history":[{"count":2,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/174938\/revisions"}],"predecessor-version":[{"id":174941,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/174938\/revisions\/174941"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/174939"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=174938"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=174938"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=174938"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}