{"id":4142,"date":"2019-07-23T17:21:06","date_gmt":"2019-07-23T09:21:06","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=4142"},"modified":"2022-05-17T13:30:00","modified_gmt":"2022-05-17T05:30:00","slug":"env","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/env","title":{"rendered":"env\u547d\u4ee4 – \u663e\u793a\u548c\u5b9a\u4e49\u73af\u5883\u53d8\u91cf"},"content":{"rendered":"\n

env\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u5355\u8bcdenvironment\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u663e\u793a\u548c\u5b9a\u4e49\u73af\u5883\u53d8\u91cf\u3002\u4e3a\u4e86\u80fd\u591f\u8ba9\u6bcf\u4e2a\u7528\u6237\u90fd\u62e5\u6709\u72ec\u7acb\u7684\u5de5\u4f5c\u73af\u5883\uff0cLinux\u7cfb\u7edf\u4f7f\u7528\u4e86\u5927\u91cf\u73af\u5883\u53d8\u91cf\uff0c\u5e73\u65f6\u8981\u60f3\u67e5\u770b\u548c\u4fee\u6539\u5219\u53ef\u4ee5\u7528env\u547d\u4ee4\u8fdb\u884c\u7ba1\u7406\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>env [\u53c2\u6570]<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-i<\/td>\u5f00\u59cb\u4e00\u4e2a\u65b0\u7684\u7a7a\u7684\u73af\u5883<\/td><\/tr>
-u<\/td>\u4ece\u5f53\u524d\u73af\u5883\u4e2d\u5220\u9664\u6307\u5b9a\u7684\u53d8\u91cf<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u663e\u793a\u5f53\u524d\u7cfb\u7edf\u7684\u5168\u90e8\u73af\u5883\u53d8\u91cf\u4fe1\u606f\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# env<\/strong><\/pre>\n\n\n\n

\u5220\u9664\u5f53\u524d\u7cfb\u7edf\u4e2d\u7684\u6307\u5b9a\u73af\u5883\u53d8\u91cf\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# env -u PWD<\/strong><\/pre>\n\n\n\n

\u5b9a\u4e49\u5f53\u524d\u7cfb\u7edf\u4e2d\u7684\u6307\u5b9a\u73af\u5883\u53d8\u91cf\u503c\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# env PWD=\/root<\/strong><\/pre>\n","protected":false},"excerpt":{"rendered":"

env\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u5355\u8bcdenvironment\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u663e\u793a\u548c\u5b9a\u4e49\u73af\u5883\u53d8\u91cf\u3002\u4e3a\u4e86\u80fd\u591f\u8ba9\u6bcf\u4e2a\u7528\u6237\u90fd\u62e5\u6709 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4142"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=4142"}],"version-history":[{"count":7,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4142\/revisions"}],"predecessor-version":[{"id":9796,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/4142\/revisions\/9796"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=4142"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=4142"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=4142"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}