Choosing between multiple executables with same name in Linux

后端 未结 4 1841
借酒劲吻你
借酒劲吻你 2021-02-01 15:02

The system I am using has gnuplot installed in /usr/bin. I don\'t have root, but I needed a newer version of gnuplot, so I installed it to

相关标签:
4条回答
  • 2021-02-01 15:31

    Besides modifying the PATH as has been explained, you can also use aliases like this (in BASH)

    alias gn=$HOME/usr/bin/gnuplot
    

    then you just run it with

    gn
    
    0 讨论(0)
  • 2021-02-01 15:40

    Executables are found in PATH order. Your PATH apparently is set up such that /usr/bin precedes ~/usr/bin/.

    0 讨论(0)
  • 2021-02-01 15:41

    Executables are found in PATH order. You need to prepend ${HOME}/usr/bin to your path, like so:

    export PATH="${HOME}/usr/bin:$PATH"
    
    0 讨论(0)
  • 2021-02-01 15:48

    What Bombe says is ok. I would add that you should declare your user specific PATH entries inside your user's bashrc ($HOME/.bashrc), so your PATH settings only apply to your user.

    0 讨论(0)
提交回复
热议问题