Linux/Unix 环境变量 [英] Linux/Unix environment variables
本文介绍了Linux/Unix 环境变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Linux/Unix 环境变量保存在哪里?如何添加自己的环境变量并使其持久化,而不仅仅是在当前运行的脚本中?
Where Linux/Unix environment variables are kept? How can I add my own environment variable and make it persistent, not only within currently running script?
推荐答案
您可以将它们添加到您的配置文件中,例如 ~/.bash_profile
.全局配置文件通常位于/etc.例如/etc/profile
.如果有的话,也看看 /etc/profile.d
目录.
you can add them in your profile, eg ~/.bash_profile
. global profile is usually located in /etc. eg /etc/profile
. Take a look also at /etc/profile.d
directory if you have it.
这篇关于Linux/Unix 环境变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文