{"id":10221,"date":"2023-06-02T11:49:17","date_gmt":"2023-06-02T03:49:17","guid":{"rendered":"https:\/\/blog.iyatt.com\/?p=10221"},"modified":"2024-05-05T12:32:22","modified_gmt":"2024-05-05T04:32:22","slug":"%e8%a7%a3%e5%86%b3%e7%bb%88%e7%ab%af%e4%b8%8d%e8%87%aa%e5%8a%a8%e6%89%a7%e8%a1%8c-bashrc-%e7%9a%84%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/blog.iyatt.com\/?p=10221","title":{"rendered":"\u89e3\u51b3\u7ec8\u7aef\u4e0d\u81ea\u52a8\u6267\u884c .bashrc \u7684\u95ee\u9898"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title ez-toc-toggle\" style=\"cursor:pointer\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/blog.iyatt.com\/?p=10221\/#%E7%8E%AF%E5%A2%83\" >\u73af\u5883<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/blog.iyatt.com\/?p=10221\/#%E5%89%8D%E8%A8%80\" >\u524d\u8a00<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/blog.iyatt.com\/?p=10221\/#%E8%A7%A3%E5%86%B3\" >\u89e3\u51b3<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"%E7%8E%AF%E5%A2%83\"><\/span>\u73af\u5883<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Ubuntu 20.04 VPS\uff08\u7ec8\u7aef\u4f7f\u7528 bash\uff09<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E5%89%8D%E8%A8%80\"><\/span>\u524d\u8a00<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u524d\u6bb5\u65f6\u95f4\u642d\u5efaChatGPT QQ\u673a\u5668\u4eba\u79df\u4e86\u4e2a\u670d\u52a1\u5668\uff0c\u7136\u540e\u4e00\u5f00\u59cb\u6211\u5c31\u81ea\u5df1\u65b0\u5efa\u4e86\u4e00\u4e2a\u7528\u6237\uff0c\u628a\u9ed8\u8ba4\u7684root\u548c\u9884\u521b\u7684admin\u7528\u6237\u7981\u6b62\u767b\u5f55\u4e86\uff0c\u9ed8\u8ba4\u7684\u7ec8\u7aef\u914d\u8272\u662f\u6bd4\u8f83\u5355\u8c03\u7684\uff0c\u5b8c\u5168\u5c31\u662f\u4e00\u79cd\u989c\u8272\uff0c\u6bd4\u5982\u6267\u884cls\u4e0d\u4f1a\u6839\u636e\u6587\u4ef6\u7c7b\u578b\u6743\u9650\u4e0d\u540c\u5448\u73b0\u4e0d\u540c\u7684\u989c\u8272\u7684\uff0c\u6240\u4ee5\u8981\u914d\u7f6e ~\/.bashrc \u6587\u4ef6\uff0c\u8fd9\u4e2a\u6587\u4ef6\u901a\u5e38\u662f\u5728\u6253\u5f00\u65b0\u7ec8\u7aef\u7684\u65f6\u5019\u4f1a\u81ea\u52a8\u6267\u884c\uff0c\u914d\u8272\u4e4b\u7c7b\u7684\u5199\u5728\u91cc\u9762\u5c31\u4f1a\u81ea\u52a8\u751f\u6548\uff0c\u4f46\u662f\u8fd9\u6b21\u5374\u5e76\u6ca1\u6709\u751f\u6548\uff0c\u540e\u9762\u624d\u53d1\u73b0\u662f\u6ca1 profile \u6587\u4ef6<\/p>\n<h2><span class=\"ez-toc-section\" id=\"%E8%A7%A3%E5%86%B3\"><\/span>\u89e3\u51b3<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>\u5728\u5bb6\u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2a\u6587\u4ef6\u540d\u4e3a .bash_profile<\/p>\n<pre><code class=\"language-bash\">touch ~\/.bash_profile<\/code><\/pre>\n<p>\u518d\u5411\u91cc\u9762\u5199\u5165\u4e0b\u9762\u5185\u5bb9\uff08\u6211\u4ece\u53e6\u5916\u4e00\u4e2a\u670d\u52a1\u5668\u62f7\u8d1d\u8fc7\u6765\u7684\uff09<\/p>\n<pre><code class=\"language-bash\"># ~\/.profile: executed by the command interpreter for login shells.\n# This file is not read by bash(1), if ~\/.bash_profile or ~\/.bash_login\n# exists.\n# see \/usr\/share\/doc\/bash\/examples\/startup-files for examples.\n# the files are located in the bash-doc package.\n\n# the default umask is set in \/etc\/profile; for setting the umask\n# for ssh logins, install and configure the libpam-umask package.\n#umask 022\n\n# if running bash\nif [ -n &quot;$BASH_VERSION&quot; ]; then\n    # include .bashrc if it exists\n    if [ -f &quot;$HOME\/.bashrc&quot; ]; then\n        . &quot;$HOME\/.bashrc&quot;\n    fi\nfi\n\n# set PATH so it includes user&#039;s private bin if it exists\nif [ -d &quot;$HOME\/bin&quot; ] ; then\n    PATH=&quot;$HOME\/bin:$PATH&quot;\nfi\n\n# set PATH so it includes user&#039;s private bin if it exists\nif [ -d &quot;$HOME\/.local\/bin&quot; ] ; then\n    PATH=&quot;$HOME\/.local\/bin:$PATH&quot;\nfi<\/code><\/pre>\n<p>\u4e4b\u540e\u8fde\u63a5\u7684\u7ec8\u7aef\u5c31\u4f1a\u81ea\u52a8\u6267\u884c .bashrc \u6587\u4ef6\u4e86<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2023\/06\/image-1685677695819.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 611px; --smush-placeholder-aspect-ratio: 611\/117;\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73af\u5883 Ubuntu 20.04 VPS\uff08\u7ec8\u7aef\u4f7f\u7528 bash\uff09 \u524d\u8a00 \u524d\u6bb5\u65f6\u95f4\u642d\u5efaChatGPT QQ\u673a\u5668\u4eba\u79df\u4e86 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"zakra_page_container_layout":"customizer","zakra_page_sidebar_layout":"customizer","zakra_remove_content_margin":false,"zakra_sidebar":"customizer","zakra_transparent_header":"customizer","zakra_logo":0,"zakra_main_header_style":"default","zakra_menu_item_color":"","zakra_menu_item_hover_color":"","zakra_menu_item_active_color":"","zakra_menu_active_style":"","zakra_page_header":true,"_lmt_disableupdate":"no","_lmt_disable":"no","footnotes":""},"categories":[1,598,580],"tags":[],"class_list":["post-10221","post","type-post","status-publish","format-standard","hentry","category-all","category-linux","category-580"],"modified_by":"IYATT-yx","_links":{"self":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/10221","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10221"}],"version-history":[{"count":0,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/10221\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}