我从 .profile 和 .bashrc 中删除了一条路径,但仍然存在于 $PATH 中

I removed a path from .profile and .bashrc but still present in $PATH

我从 .profile 和 .bashrc 中删除了我之前在 $PATH 变量中添加的路径,但它仍然存在于后者中。我真的不明白为什么。有帮助吗?

谢谢

这可以使用 source 命令完成。

source ~/.profile
source ~/.bashrc

现在检查 $PATH。

echo $PATH

移除的路径将不会显示。