在Linux中具有相同名称的多个可执行文件之间进行选择 [英] Choosing between multiple executables with same name in Linux

查看:349
本文介绍了在Linux中具有相同名称的多个可执行文件之间进行选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用的系统在/usr/bin中安装了gnuplot.我没有root用户,但是我需要更新版本的gnuplot,所以我将其安装到了$HOME/usr/bin.

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 $HOME/usr/bin.

我在路径中添加了$HOME/usr/bin,但是如果我只是使用gnuplot命令,它仍会执行/usr/bin中的那个.我宁愿不必在每次使用时都指定$HOME/usr/bin/gnuplot.

I added $HOME/usr/bin to my path, but it still executes the one in /usr/bin if I just use the gnuplot command. I'd rather not have to specify $HOME/usr/bin/gnuplot every time I have to use it.

如何告诉Linux使用我的主目录中的那个而不使用/usr/bin中的那个?

How do I tell Linux to use the one in my home directory, and not the one in /usr/bin?

推荐答案

可执行文件按PATH顺序找到.您需要将${HOME}/usr/bin放在路径前面,像这样:

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

export PATH="${HOME}/usr/bin:$PATH"

这篇关于在Linux中具有相同名称的多个可执行文件之间进行选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆