PATH、LD_LIBRARY_PATH等最好加在.profile/.bashr_profile下,而不是.bashrc下。
因为.bashrc只对当前shell程序有效,而其他新建的shell程序(Terminal)都不会读取这个文件中的变量。
https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path
即,如果想对全session有效,则加载.profile/.bashr_profile下。
如果是临时的,对当前shell,则可以临时加在.bashrc下
原文:https://www.cnblogs.com/simpleminds/p/12653800.html