echo $PATH
给我:
/Library/Frameworks/Python.framework/Versions/3.4/bin:/Applications/Sublime Text 2.app/Contents/SharedSupport/bin:/Users/pathreskoo/anaconda/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/opt/local/bin:/opt/local/sbin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin
但是当我想把/usr/local/bin
的顺序换到/Library/Frameworks/Python.framework/Versions/3.4/bin
的前面时,我输入
sudo emacs /etc/paths
我只获得
/usr/local/bin:
/usr/bin:
/bin:
/usr/sbin:
/sbin:
如何将/usr/local/bin
添加到PATH
的最前面?
/usr/local/bin
添加到路径的前面比完全覆盖继承的值 (PATH=/usr/local/bin:$PATH
) 更安全。重复项不会造成任何损害,而且您的路径不太可能变得如此庞大以至于引起性能问题。 - chepner