{"id":280015,"date":"2023-08-13T20:10:44","date_gmt":"2023-08-13T12:10:44","guid":{"rendered":"https:\/\/gulass.cn\/szhjblcymlgx.html"},"modified":"2023-08-13T20:10:44","modified_gmt":"2023-08-13T12:10:44","slug":"szhjblcymlgx","status":"publish","type":"post","link":"https:\/\/gulass.cn\/szhjblcymlgx.html","title":{"rendered":"\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u5e38\u7528\u547d\u4ee4\u66f4\u65b0\u73af\u5883test\u7b2c\u4e00\u7ae0"},"content":{"rendered":"

\u4fee\u6539\u6587\u4ef6\u7684\u521b\u5efa\u65e5\u671f\u548c\u4fee\u6539\u65e5\u671f_linux\u4fee\u6539readonly\u6587\u4ef6_\u4fee\u6539\u6587\u4ef6\u521b\u5efa\u65f6\u95f4\u4f1a\u88ab\u53d1\u73b0\u5417<\/p>\n

Linux<\/a>\u662f\u4e00\u4e2a\u591a\u7528\u6237\u7684\u64cd\u4f5c\u7cfb\u7edf<\/a>\u3002\u591a\u7528\u6237\u610f\u5473\u7740\u6bcf\u4f4d\u7528\u6237\u767b\u5165\u7cfb\u7edf\u540e\uff0c\u90fd\u6709\u81ea\u5df1\u4e13\u7528\u7684\u8fd0\u884c\u73af\u5883\u3002\u800c\u8fd9\u4e2a\u73af\u5883\u662f\u7531\u4e00\u7ec4\u53d8\u91cf<\/a>\u6240\u5b9a\u4e49,\u8fd9\u7ec4\u53d8\u91cf\u88ab\u79f0\u4e3a\u73af\u5883\u53d8\u91cf\u3002\u7528\u6237\u53ef\u4ee5\u5bf9\u81ea\u5df1\u7684\u73af\u5883\u53d8\u91cf\u8fdb\u884c\u66f4\u6539\u4ee5\u8fbe\u5230\u5bf9\u73af\u5883\u7684\u8981\u6c42\u3002<\/p>\n

\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u7684\u65b9\u5f0f<\/p>\n

\u8fd9\u7c7b\u53d8\u91cf\u5bf9\u7cfb\u7edf\u5185\u7684\u6240\u6709\u7528\u6237\u90fd\u751f\u6548\uff0c\u6240\u6709\u7528\u6237\u90fd\u53ef\u4ee5\u4f7f\u7528\u8fd9\u7c7b\u53d8\u91cf\u3002\u4f5c\u7528\u8303\u56f4\u662f\u6574\u4e2a\u7cfb\u7edf\u3002<\/p>\n

\u6b64\u6587\u4ef6\u53ea\u5728root\u4e0b\u5c31\u80fd\u66f4\u6539\u3002<\/p>\n

\n

<\/span>#\u00a0vi\u00a0\/etc\/profile<\/span>
export<\/span>\u00a0CLASSPATH=.\/JAVA_HOME\/lib:$JAVA_HOME<\/span>\/jre\/lib
<\/code><\/pre>\n<\/p>\n

\u6dfb\u52a0\u5b8c\u6210\u540e\u65b0\u7684\u73af\u5883\u53d8\u91cf\u4e0d\u4f1a\u7acb\u523b\u751f\u6548\uff0c\u7acb\u523b\u751f\u6548\u987b\u8981\u8fd0\u884csource\/etc\/profile\uff0c\u5426\u5219\u53ea\u80fd\u5728\u4e0a\u6b21\u91cd\u8fdb\u6b64\u7528\u6237\u65f6\u624d\u4f1a\u751f\u6548\u3002<\/p>\n

\u5728\u7528\u6237\u76ee\u5f55\u4e0b\u7684.bash_profile\u6587\u4ef6\u4e2d\u6dfb\u52a0\u53d8\u91cf\uff0c\u8be5\u6587\u4ef6\u662f\u9690\u85cf\u6587\u4ef6\uff0c\u53ef\u4f7f\u7528ll-a\u67e5\u770b\uff1a<\/p>\n

\n

<\/span>$\u00a0whoami\u00a0
rethink

$\u00a0vi\u00a0\/home\/rethink\/.bash_profile
export<\/span>\u00a0CLASSPATH=.\/JAVA_HOME\/lib:$JAVA_HOME<\/span>\/jre\/lib\u00a0

$\u00a0source<\/span>\u00a0\/home\/rethink\/.bash_profile
<\/code><\/pre>\n<\/p>\n

\u53ef\u4ee5\u7406\u89e3\u4e3a.bash_profile\u6587\u4ef6\u53ea\u4f1a\u5728\u7528\u6237\u767b\u5165\u7684\u65f6\u4faf\u8bfb\u53d6\u4e00\u6b21\uff0c\u800c.bashrc\u5728\u6bcf\u6b21\u6253\u5f00\u7ec8\u7aef\u8fdb\u884c\u4e00\u6b21\u65b0\u7684\u4f1a\u8bdd\u65f6\u5c31\u4f1a\u8bfb\u53d6\u3002<\/p>\n

\u4e34\u65f6\u6709\u6548\u7684\u73af\u5883\u53d8\u91cf(\u53ea\u9488\u5bf9\u5f53\u524dshell\u6709\u6548)<\/p>\n

\u8fd9\u79cd\u73af\u5883\u53d8\u91cf\u53ea\u5bf9\u5f53\u524d\u7684shell\u6709\u6548\u3002\u5f53\u6211\u4eec\u9000\u51fa\u767b\u5165\u6216\u5219\u5173\u6389\u7ec8\u7aef\u518d\u91cd\u65b0\u6253\u5f00\u65f6\uff0c\u8fd9\u4e2a\u73af\u5883\u53d8\u91cf\u90fd\u4f1a\u6d88\u5931\u3002\u662f\u4e34\u65f6\u7684\u3002<\/p>\n

\u8bbe\u7f6e\u65b9\u5f0f\uff1a\u547d\u4ee4<\/a>\u884c\u4e0b\u76f4\u63a5\u4f7f\u7528[export\u53d8\u91cf\u540d=\u53d8\u91cf\u503c]\u5b9a\u4e49\u53d8\u91cf\u3002<\/p>\n

\n

<\/span>$\u00a0export<\/span>\u00a0
$\u00a0echo<\/span>\u00a0$NAME<\/span>
rethink
<\/code><\/pre>\n<\/p>\n

\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u5e38\u7528\u547d\u4ee4<\/p>\n

\u66f4\u65b0\u73af\u5883\u53d8\u91cf\u66f4\u65b0\u73af\u5883\u53d8\u91cf\u76f4\u63a5\u91cd\u65b0\u5f62\u53c2\u5373\u53ef\uff1aNAME='test'\uff08\u6ce8\u610f\uff1a\u53d8\u91cf\u540d\u524d\u4e0d\u987b\u8981\u52a0$\uff09\uff1b<\/p>\n

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

\n

<\/span>PATH
#\u00a0echo\u00a0$PATH<\/span>
\/usr\/local<\/span>\/sbin:\/usr\/local<\/span>\/bin:\/usr\/sbin:\/usr\/bin:\/root\/bin
<\/code><\/pre>\n<\/p>\n

\u8def\u5f84\u4e4b\u95f4\u7528\u9017\u53f7\u5206\u9694\uff0c\u8fd9\u79cd\u8def\u5f84\u90fd\u662f\u4e00\u4e9b\u53ef\u4ee5\u627e\u5230\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u76ee\u5f55\u5217\u8868\u3002\u5f53\u6211\u4eec\u8f93\u5165\u4e00\u4e2a\u6307\u4ee4\u65f6\uff0cshell\u4f1a\u5148\u68c0\u6d4b\u547d\u4ee4\u662f\u5426\u662f\u7cfb\u7edf\u5185\u90e8\u547d\u4ee4\uff0c\u5018\u82e5\u4e0d\u662f\u5219\u4f1a\u518d\u53bb\u68c0\u6d4b\u6b64\u547d\u4ee4\u662f\u5426\u662f\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\uff0cshell\u4f1a\u8bd5\u7740\u4ecePATH\u4e2d\u627e\u5bfb\u90a3\u4e9b\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>\n

\u5047\u5982shell\u5728\u8fd9\u79cd\u8def\u5f84\u76ee\u5f55\u91cc\u6ca1\u6709\u627e\u5230\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u90fd\u4f1a\u62a5\u9519\uff1b\u82e5\u627e\u5230linux\u5b9a\u65f6\u5173\u673a\u547d\u4ee4\uff0c\u7cfb\u7edf\u5c06\u8c03\u7528\u6267\u884c\u5e94\u7528\u7a0b\u5e8f\u3002\u901a\u8fc7\u8bbe\u7f6ePATH\uff0c\u53ef\u4ee5\u8ba9\u6211\u4eec\u8fd0\u884c\u7a0b\u5e8f\u6216\u6307\u4ee4\u6108\u52a0\u4fbf\u6377\u3002<\/p>\n

linux\u4fee\u6539readonly\u6587\u4ef6_\u4fee\u6539\u6587\u4ef6\u521b\u5efa\u65f6\u95f4\u4f1a\u88ab\u53d1\u73b0\u5417_\u4fee\u6539\u6587\u4ef6\u7684\u521b\u5efa\u65e5\u671f\u548c\u4fee\u6539\u65e5\u671f<\/p>\n

\u5c06\u67d0\u4e2a\u76ee\u5f55\u8def\u5f84\u52a0\u5165\u5230PATH\u4e2d\uff0c\u53ef\u4ee5\u8fd9\u6837\u5199\uff1a<\/p>\n

\n

<\/span>$\u00a0pwd<\/span>
\/root\/docker\/httpd
$\u00a0export<\/span>\u00a0PATH=$PATH<\/span>:$PWD<\/span>
$\u00a0echo<\/span>\u00a0$PATH<\/span>
\/usr\/local<\/span>\/sbin:\/usr\/local<\/span>\/bin:\/usr\/sbin:\/usr\/bin:\/root\/bin:\/root\/docker\/httpd
`\u53ef\u4ee5\u770b\u5230\u5728PATH\u540e\u9762\u5df2\u7ecf\u52a0\u4e0a\u4e86\u6211\u4eec\u5f53\u524d\u6240\u5904\u76ee\u5f55\u7684\u8def\u5f84`
<\/code><\/pre>\n<\/p>\n

\u7528\u6237\u7684\u4e3b\u5de5\u4f5c\u76ee\u5f55\uff0c\u5373\u4e3a\u7528\u6237\u767b\u5165\u5230Linux\u7cfb\u7edf\u4e2d\u65f6\u7684\u9ed8\u8ba4\u76ee\u5f55\u3002<\/p>\n

\n

<\/span>$\u00a0whoami
rethink
$\u00a0echo<\/span>\u00a0$HOME<\/span>
\/home\/rethink
<\/code><\/pre>\n<\/p>\n

\u4fdd\u5b58\u5386\u53f2\u547d\u4ee4\u7684\u6761\u6570\u3002\u6211\u4eec\u8f93\u5165\u7684\u6307\u4ee4\u5c31\u4f1a\u88ab\u7cfb\u7edf\u4fdd\u5b58\u51fa\u6765\uff0c\u8fd9\u4e2a\u73af\u5883\u53d8\u91cf\u8bb0\u5f55\u7684\u5c31\u662f\u4fdd\u6301\u6307\u4ee4\u7684\u6761\u6570\u3002\u901a\u5e38\u4e3a1000\u3002<\/p>\n

\n

<\/span>$\u00a0echo<\/span>\u00a0$HISTSIZE<\/span>
1000
$\u00a0HISTSIZE=1001
$\u00a0echo<\/span>\u00a0$HISTSIZE<\/span>
1001
<\/code><\/pre>\n<\/p>\n

\u5386\u53f2\u547d\u4ee4\u662f\u88ab\u4fdd\u5b58\u5728\u663e\u5b58\u4e2d\u7684linux\u4fee\u6539readonly\u6587\u4ef6<\/strong>\uff0c\u5f53\u9000\u51fa\u6216\u5219\u767b\u9646shell\u65f6\uff0c\u4f1a\u624b\u52a8\u4fdd\u5b58\u6216\u8bfb\u53d6\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7history\u547d\u4ee4\u6765\u67e5\u770b\u3002\u53ef\u4ee5\u4f7f\u7528\u7b26\u53f7!\u6267\u884c\u6307\u5b9a\u5e8f\u53f7\u7684\u5386\u53f2\u547d\u4ee4\u3002\u6bd4\u5982\uff0c\u8981\u6267\u884c\u7b2c2\u4e2a\u5386\u53f2\u547d\u4ee4linux\u4f0a\u7538\u56ed\uff0c\u5219\u8f93\u5165!2\u3002<\/p>\n

\n

<\/span>$\u00a0history<\/span>\u00a05
\u00a0\u00a0\u00a059\u00a0\u00a0ls
\u00a0\u00a0\u00a060\u00a0\u00a0who
\u00a0\u00a0\u00a061\u00a0\u00a0history<\/span>\u00a0|\u00a0head\u00a0-n\u00a05
\u00a0\u00a0\u00a062\u00a0\u00a0who\u00a0am\u00a0i
\u00a0\u00a0\u00a063\u00a0\u00a0history<\/span>\u00a05
$\u00a0!62
who\u00a0am\u00a0i
root\u00a0\u00a0\u00a0\u00a0\u00a0pts\/0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a02018-04-04\u00a011:00\u00a0(101.81.92.18)
<\/code><\/pre>\n<\/p>\n

\u5f53\u524d\u7528\u6237\u767b\u9646\u540d\u3002<\/p>\n

\n

<\/span>$\u00a0echo<\/span>\u00a0$LOGNAME<\/span>
rethink
<\/code><\/pre>\n<\/p>\n

\n

<\/span>$\u00a0echo<\/span>\u00a0$HOSTNAME<\/span>
JDu4e00u53f7
<\/code><\/pre>\n<\/p>\n

\u5f53\u524d\u7528\u6237\u4f7f\u7528\u7684shell\u79cd\u7c7b\u3002<\/p>\n

\n

<\/span>$\u00a0echo<\/span>\u00a0$SHELL<\/span>
\/bin\/bash
<\/code><\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"

\u7528\u6237\u53ef\u4ee5\u5bf9\u81ea\u5df1\u7684\u73af\u5883\u53d8\u91cf\u8fdb\u884c\u4fee\u6539\u4ee5\u8fbe\u5230\u5bf9\u73af\u5883\u7684\u8981\u6c42\u3002\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u7684\u65b9\u6cd5\uff0c\u539f\u5219\u4e0a\u8bb2\u8bbe\u7f6e\u6b64\u7c7b\u73af\u5883\u53d8\u91cf\u65f6\u5728\u8fd9\u4e24\u4e2a\u6587\u4ef6\u4efb\u610f\u4e00\u4e2a\u91cc\u9762\u6dfb\u52a0\u90fd\u662f\u53ef\u4ee5\u7684\uff0c\u8fd9\u4e24\u4e2a\u6587\u4ef6\u7684\u533a\u522b\u4e3a\uff1a.\u6587\u4ef6\u53ea\u4f1a\u5728\u7528\u6237\u767b\u5f55\u7684\u65f6\u5019\u8bfb\u53d6\u4e00\u6b21\uff0c\u800c.\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf\u5e38\u7528\u547d\u4ee4\u5e38\u7528\u73af\u5883\u53d8\u91cf\u8def\u5f84\u4e4b\u95f4\u7528\u5192\u53f7\u5206\u9694\uff0c\u8fd9\u4e9b\u8def\u5f84\u90fd\u662f\u4e00\u4e9b\u53ef\u4ee5\u627e\u5230\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u76ee\u5f55\u5217\u8868\u3002\u5728\u8fd9\u4e9b\u8def\u5f84\u76ee\u5f55\u91cc\u6ca1\u6709\u627e\u5230\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u5c31\u4f1a\u62a5\u9519\uff1b\u82e5\u627e\u5230\uff0c\u7cfb\u7edf\u5c06\u8c03\u7528\u6267\u884c\u5e94\u7528\u7a0b\u5e8f\u3002\u7cfb\u7edf\u4e2d\u65f6\u7684\u9ed8\u8ba4\u76ee\u5f55\u3002<\/p>\n","protected":false},"author":1,"featured_media":280016,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-280015","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/280015","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=280015"}],"version-history":[{"count":0,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/280015\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/280016"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=280015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=280015"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=280015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}

\u5728\u4e0a\u56fe\u4e2d\u7528\u7ea2\u6846\u6846\u4f4f\u4e86\u4e24\u4e2a\u6587\u4ef6\uff1a.bashrc\u548c.bash_profilelinux\u4fee\u6539readonly\u6587\u4ef6<\/strong>\uff0c\u539f\u5219\u4e0a\u8bb2\u8bbe\u7f6e\u8fd9\u79cd\u73af\u5883\u53d8\u91cf\u65f6\u5728\u8fd9\u4e24\u4e2a\u6587\u4ef6\u4efb\u610f\u4e00\u4e2a\u4e0a\u9762\u6dfb\u52a0\u90fd\u662f\u53ef\u4ee5\u7684\uff0c\u8fd9\u4e24\u4e2a\u6587\u4ef6\u7684\u533a\u522b\u4e3a\uff1a.bash_profile\u662f\u4ea4\u4e92\u5f0flogin\u5f62\u5f0f\u6b65\u5165bashshell<\/a>\u8fd0\u884c\uff0c.bashrc\u662f\u4ea4\u4e92\u5f0fnon-login\u5f62\u5f0f\u6b65\u5165bashshell\u8fd0\u884c\u3002<\/p>\n