如何从linux中删除环境变量? unset命令仅从当前会话中删除env变量,但我需要将其永久删除。有什么建议么?
只需在您的.bashrc中使用unset:
unset
unset VAR
然后运行source .bashrc。 .bashrc在每次启动时运行。
source .bashrc